-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
39 lines (37 loc) · 1.06 KB
/
webpack.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
var path = require('path');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var autoprefixer = require('autoprefixer');
var webpack = require('webpack');
const OUTPUT_DIR = path.join(__dirname, 'client', 'build');
module.exports = {
entry: {
'main': path.join(__dirname, 'client', 'js', 'index.js'),
'style': path.join(__dirname, 'client', 'css', 'style.scss')
},
output: {
path: OUTPUT_DIR,
filename: '[name].js'
},
module: {
loaders: [
{test: /\.js$/, loader: 'babel-loader', exclude: /(node_modules|bower_components)/, query: {presets: ['es2015'], plugins: ['transform-runtime']}},
{test: /\.scss$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader!sass-loader')},
{test: /\.html$/, loader: 'html-loader'}
]
},
preLoaders : [{
test: /\.jsx?$/,
loader: "eslint-loader",
exclude: /node_modules/
}],
plugins: [
new ExtractTextPlugin('[name].css'),
new webpack.ProvidePlugin({
$: "jquery",
jQuery: "jquery"
})
],
postcss: function () {
return [autoprefixer];
}
};