bugsnag / webpack-bugsnag-plugins

Webpack plugins for common BugSnag actions.
MIT License
32 stars 29 forks source link

Match against sourcemaps output to directories other than dist/ #20

Closed grrowl closed 5 years ago

grrowl commented 6 years ago

This may not match every use case, but we had trouble integrating this plugin with our webpack config because we don't want to output sourcemaps into our distributable directory, for security and IP reasons. So, we set the SourceMapDevToolPlugin's config.filename to ../tmp/[name].js.map (compared to webpackConfig.output.path = [hash]/[name].js)

This breaks BugsnagSourceMapUploaderPlugin which requires the absolute path to the map be exactly the output file's path, minus .map. Now this plugin will match files with the same name in any directory.

bengourley commented 5 years ago

@grrowl thanks for this suggestion, we ended up implementing this in a slightly different way, but it should work for your use case.