-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
34 lines (33 loc) · 975 Bytes
/
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
var path = require('path');
var webpack = require('webpack');
var autoprefixer = require('autoprefixer');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: [
'./public/assets/js/app'
],
output: {
filename: '[name].js',
path: path.join(__dirname, 'public', 'assets'),
publicPath: '/assets/'
},
module: {
loaders: [
{ test: /\.sass$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader!postcss-loader!sass-loader?sourceMap=true') },
{ test: /\.js$/, loader: 'babel-loader?presets[]=es2015' }
]
},
plugins: [
new ExtractTextPlugin('[name].css'),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.NoErrorsPlugin()
],
resolveLoader: {
modulesDirectories: ['node_modules']
},
resolve: {
extensions: ['', '.js', '.sass'],
root: [path.join(__dirname, 'public', 'assets')]
},
postcss: [ autoprefixer({ browsers: ['last 2 versions'] }) ]
}