-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack-production.config.js
35 lines (34 loc) · 1 KB
/
webpack-production.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
var webpack = require('webpack');
var path = require('path');
var fs = require('fs');
module.exports = {
entry: { main: './app/mainApp' },
output: {
path: __dirname + '/dist/',
filename: 'bundle.js',
publicPath: '/dist/',
contentBase: __dirname + '/public/',
libraryTarget: 'commonjs2'
},
target: 'atom',
externals: fs.readdirSync('node_modules').filter(function(x) { return x !== '.bin' }),
module: {
loaders: [
{ test: /\.html?$/, loader: 'html-loader' },
{ test: /\.less$/, loader: "style!css!less" },
{ test: /\.jsx?$/, loaders: [ 'react-hot', 'babel-loader?stage=1' ] },
{ test: /\.js?$/, loader: 'babel-loader?stage=1' }
]
},
devtool: opts.devtool,
debug: true,
resolve: {
root: path.join(__dirname, 'app'),
modulesDirectories: [ 'node_modules' ],
extensions: [ '', '.js', '.jsx', '.json' ]
},
plugins: [
new webpack.PrefetchPlugin('react'),
new webpack.PrefetchPlugin('react/lib/ReactComponentBrowserEnvironment'),
]
};