Last active
February 14, 2017 05:52
-
-
Save arackaf/5aff90f1ee503a68fcbce4aa9d1e9ac2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; | |
| var path = require('path'); | |
| var webpack = require('webpack'); | |
| module.exports = { | |
| entry: './reactStartup.js', | |
| output: { | |
| filename: 'bundle.js', | |
| path: path.resolve(__dirname, 'dist') | |
| }, | |
| resolve: { | |
| alias: { | |
| 'simple-react-bootstrap': 'node_modules/simple-react-bootstrap/dist/simple-react-bootstrap.js', | |
| 'jscolor': 'util/jscolor.js' | |
| }, | |
| modules: [ | |
| path.resolve('./'), | |
| path.resolve('./node_modules'), | |
| ] | |
| }, | |
| module: { | |
| loaders: [ | |
| { | |
| test: /\.js$/, | |
| exclude: /node_modules/, | |
| loader: 'babel-loader', | |
| query: { | |
| presets: ['react', 'es2015'] | |
| } | |
| } | |
| ] | |
| }, | |
| plugins: [ | |
| new BundleAnalyzerPlugin({ | |
| analyzerMode: 'static' | |
| }), | |
| new webpack.optimize.CommonsChunkPlugin({ | |
| name: 'node-static', | |
| filename: 'node-static.js', | |
| minChunks(module, count) { | |
| var context = module.context; | |
| return context && context.indexOf('node_modules') >= 0; | |
| }, | |
| }), | |
| ] | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment