-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.docs.config.js
executable file
·43 lines (40 loc) · 1.51 KB
/
webpack.docs.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
36
37
38
39
40
41
42
43
var webpack = require('webpack');
var path = require('path');
var commonsPlugin = new webpack.optimize.CommonsChunkPlugin('common.js');
//var ExtractTextPlugin = require("extract-text-webpack-plugin");
var entry = require('./index.js');
module.exports = {
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': 'JSON.stringify("development")'
}),
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin()
],
entry: [
'webpack-dev-server/client?http://127.0.0.1:3000',// WebpackDevServer host and port
'webpack/hot/only-dev-server',
'./docs/demo/app.js'
]
,
output: {
path: path.join(__dirname, 'dist/demo/'),
filename: 'bundle.js',
publicPath: '/dist/demo'
},
module: {
loaders: [
{ test: /\.css$/, loader: 'style-loader!css-loader' },
{ test: /\.js$/, loaders: ['jsx-loader?harmony','react-hot'] },
{ test: /\.scss$/, loader: 'style!css!sass?sourceMap'},
{ test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192'},
{ test: /\.jsx?$/,exclude: /(node_modules|bower_components)/,loaders: ['react-hot','babel']}
]
},
resolve: {
root: '',
extensions: ['', '.js', '.json', '.scss'],
alias: {
}
}
};