Ship source code to NPM (#1095)
* Ship sources in NPM package. * Use external source files for sourcemaps. * Remove broken sourcemap rule.
This commit is contained in:
parent
8e00379fdb
commit
7df903c714
@ -31,8 +31,8 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"dist/",
|
"src/",
|
||||||
"README.md"
|
"dist/"
|
||||||
],
|
],
|
||||||
"pre-commit": "lint:staged",
|
"pre-commit": "lint:staged",
|
||||||
"jest": {
|
"jest": {
|
||||||
|
@ -46,10 +46,15 @@ module.exports = merge.smart(require('./webpack.base.js'), {
|
|||||||
new webpack.SourceMapDevToolPlugin({
|
new webpack.SourceMapDevToolPlugin({
|
||||||
// asset matching
|
// asset matching
|
||||||
test: /\.js?$/,
|
test: /\.js?$/,
|
||||||
exclude: /node_modules/,
|
|
||||||
|
|
||||||
// file and reference
|
// file and reference
|
||||||
filename: '[file].map',
|
filename: '[file].map',
|
||||||
|
|
||||||
|
// don't include source file content, since we link to the actual file
|
||||||
|
noSources: true,
|
||||||
|
|
||||||
|
// sourcemap is in 'dist', webpack context is in 'src'
|
||||||
|
moduleFilenameTemplate: info => path.posix.normalize(`../src/${info.resourcePath}`),
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user