inline-source-webpack-plugin icon indicating copy to clipboard operation
inline-source-webpack-plugin copied to clipboard

SourceMaps referenced but not written or referenced instead of inlined

Open tholewebgods opened this issue 1 year ago • 1 comments

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

tholewebgods avatar Jun 27 '23 07:06 tholewebgods

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

tholewebgods avatar Jun 27 '23 07:06 tholewebgods