Have source-map-loader ignore node_modules packages

This commit is contained in:
Fabio Berger
2018-05-23 21:27:08 -07:00
parent 5c88f43e15
commit a88e8ffe79

View File

@@ -1,6 +1,6 @@
const path = require('path'); const path = require('path');
const webpack = require('webpack'); const webpack = require('webpack');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin') const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
module.exports = { module.exports = {
entry: ['./ts/index.tsx'], entry: ['./ts/index.tsx'],
@@ -25,6 +25,11 @@ module.exports = {
{ {
test: /\.js$/, test: /\.js$/,
loader: 'source-map-loader', loader: 'source-map-loader',
exclude: [
// instead of /\/node_modules\//
path.join(process.cwd(), 'node_modules'),
path.join(process.cwd(), '../..', 'node_modules'),
],
}, },
{ {
test: /\.tsx?$/, test: /\.tsx?$/,