forked from dry-rb/dry-rb.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
44 lines (37 loc) · 1019 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
35
36
37
38
39
40
41
42
43
44
var webpack = require('webpack');
var path = require('path');
var Clean = require('clean-webpack-plugin');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var autoprefixer = require('autoprefixer')
module.exports = {
debug: true,
entry: {
main: [
'./assets/javascripts/site.js',
'./assets/stylesheets/site.css.scss',
],
},
output: {
path: __dirname + '/.tmp/dist',
filename: 'assets/javascripts/site.js',
},
module: {
preLoaders: [{
test: /\.scss$/,
exclude: /node_modules|\.tmp|vendor/,
loader: 'import-glob',
}],
loaders: [
{ test: /\.js?$/, loader: "babel", exclude: /node_modules/ },
{ test: /\.scss$/, exclude: /node_modules|\.tmp|vendor/,
loader: ExtractTextPlugin.extract('css!postcss-loader!sass-loader') }
]
},
postcss: function () {
return [autoprefixer];
},
plugins: [
new Clean(['.tmp']),
new ExtractTextPlugin('assets/stylesheets/site.css', { allChunks: true })
]
};