-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
47 lines (44 loc) · 1.25 KB
/
Copy pathwebpack.config.js
File metadata and controls
47 lines (44 loc) · 1.25 KB
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
44
45
46
47
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: './index.js',
plugins: [
new webpack.DefinePlugin({
'process.env': {
BROWSER : JSON.stringify(true),
NODE_ENV : JSON.stringify(process.env.NODE_ENV || 'development')
}
}),
new ExtractTextPlugin('main.css')
],
output: {
path : __dirname + '/css/',
libraryTarget : 'commonjs',
filename : 'main.js'
},
target : 'node',
externals : {
react: 'React'
},
module: {
loaders: [
{
test : /\.css$/,
loader : ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader')
},
{
test : /\.less$/,
loader : ExtractTextPlugin.extract('style-loader', 'css-loader!less-loader!postcss-loader?parser=postcss-safe-parser')
},
{ test: /\.jsx$/, loader: 'babel', exclude: [/node_modules/, /public/] },
{ test: /\.js$/, loader: 'babel', exclude: [/node_modules/, /public/] },
{ test: /\.svg/, loader: 'url-loader' }
]
},
postcss: function () {
return [
require('postcss-inline-svg'),
require('autoprefixer')
];
}
};