UNPKG

@aiot-toolkit/packager

Version:

@aiot-toolkit/packager

3 lines (2 loc) 781 B
"use strict";var _Compilation=_interopRequireDefault(require("webpack/lib/Compilation")),_webpackSources=require("webpack-sources");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function SourcemapFixPlugin(e={}){this.options=e}function warpNewLine(e,o){if(/\.js$/.test(e))return new _webpackSources.ConcatSource("\n",o.assets[e])}SourcemapFixPlugin.prototype.apply=function(e){e.hooks.compilation.tap("SourcemapFixPlugin",(function(e){e.hooks.processAssets.tap({name:"SourcemapFixPlugin",stage:_Compilation.default.PROCESS_ASSETS_STAGE_DEV_TOOLING},(()=>{e.chunks.forEach((function(o){o.files.forEach((function(o){const i=warpNewLine(o,e);i&&(e.assets[o]=i)}))}))}))}))},module.exports=SourcemapFixPlugin; //# sourceMappingURL=sourcemap-fix-plugin.js.map