forked from SkaterDad/cycle-snabbdom-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.production.js
39 lines (38 loc) · 1.22 KB
/
webpack.production.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
/*eslint-disable*/
var webpack = require('webpack'),
path = require('path'),
ExtractTextPlugin = require('extract-text-webpack-plugin'),
autoprefixer = require('autoprefixer');
module.exports = {
entry: './src/client.js',
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js'
},
module: {
preLoaders: [
{test: /\.js$/, loader: "eslint-loader", exclude: /node_modules/}
],
loaders: [
{
test: /\.s?css$/, //match css or scss
loader: ExtractTextPlugin.extract("style", "css!postcss!sass")
},
{
test: /\.js$/,
loaders: ['babel?cacheDirectory=true&presets=es2015'],
//exclude: /node_modules.((?!snabbdom-to-html)).*/ //webpack pulls in snabbdom-to-html as part of cycle-snabbdom. Uflify doesn't like es6 code.
exclude: /node_modules/
}
]
},
postcss: function () {
return [autoprefixer];
},
plugins: [
new ExtractTextPlugin("bundle.css"),
//new webpack.IgnorePlugin(/snabbdom-to-html/),
new webpack.optimize.OccurenceOrderPlugin()
]
};
/*eslint-enable*/