inline-source-webpack-plugin
inline-source-webpack-plugin copied to clipboard
SourceMaps referenced but not written or referenced instead of inlined
Problem description
When inlining a script using
new InlineSourceWebpackPlugin({
compress: true,
noAssetMatch: "error",
}),
and
<script inline inline-asset="foo-main.+\.js$" inline-asset-delete></script>
The asset to be inlined is not located in the physical filesystem, but emitted by Webpack.
The resulting file references a SourceMap like so:
//# sourceMappingURL=foo.0d0fb7084e53fd4fd4b3.js.map
but the file is not present in the Filesystem.
Expected behavior
The SourceMap
- is inlined or
- .map file is written to the proper location
I see. By using inline-asset-delete
the .js and .map file have been deleted.
Let's modify the expected behavior:
- The SourceMap is inlined when the asset file is deleted
- The .map file is not deleted, when asset deletion was requested (delete only .js) and the proper relative path to the .map is written