Skip to content

Instantly share code, notes, and snippets.

@zecuria
Created April 24, 2018 00:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zecuria/23db4aea486460a04f3a505b309c8220 to your computer and use it in GitHub Desktop.
Save zecuria/23db4aea486460a04f3a505b309c8220 to your computer and use it in GitHub Desktop.
Webpack Valid Sourcemap Config
var path = require('path');
var webpack = require('webpack');
module.exports = {
entry: {
'Dashboard/index': './src/Dashboard/index.js',
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: '[name].js',
},
module: {
rules: [
{ test: /\.(js)$/, use: 'babel-loader' },
{ test: /\.(jsx)$/, use: 'babel-loader' }
]
},
optimization: {
splitChunks:{
cacheGroups: {
vendor: {
test: /react|react-dom|mobx|mobx-react|moment|axios/,
name: "vendor",
chunks: "all",
enforce: true
}
}
}
},
mode: "development",
devtool: "source-map"
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment