Skip to content

Commit

Permalink
Ship source code to NPM (#1095)
Browse files Browse the repository at this point in the history
* Ship sources in NPM package.

* Use external source files for sourcemaps.

* Remove broken sourcemap rule.
  • Loading branch information
tech4him1 authored and erquhart committed Mar 28, 2018
1 parent 8e00379 commit 7df903c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
]
},
"files": [
"dist/",
"README.md"
"src/",
"dist/"
],
"pre-commit": "lint:staged",
"jest": {
Expand Down
7 changes: 6 additions & 1 deletion webpack.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,15 @@ module.exports = merge.smart(require('./webpack.base.js'), {
new webpack.SourceMapDevToolPlugin({
// asset matching
test: /\.js?$/,
exclude: /node_modules/,

// file and reference
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}`),
}),
],
});

0 comments on commit 7df903c

Please sign in to comment.