forked from streetlives/streetlivesnyc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
46 lines (44 loc) · 1.19 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
40
41
42
43
44
45
46
const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const autoprefixer = require('autoprefixer')({browsers: 'last 2 versions'});
const PATHS = {
app: path.join(__dirname, 'sources'),
app_js: path.join(__dirname, 'sources', 'js'),
app_scss: path.join(__dirname, 'sources', 'scss'),
build: path.join(__dirname, 'public')
};
module.exports = {
entry: {
app: PATHS.app + '/js/app.js'
},
resolve: {
extensions: ['', '.js', '.jsx'],
alias: {
'react': path.join(__dirname, 'node_modules', 'react')
}
},
output: {
path: PATHS.build,
filename: 'streetlives.js'
},
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel-loader'],
include: PATHS.app_js
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('style', 'css!postcss-loader!sass'),
include: PATHS.app_scss
}
]
},
postcss: function () {
return [autoprefixer];
},
plugins: [
new ExtractTextPlugin('streetlives.css')
]
};