-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
50 lines (43 loc) · 1.17 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
47
48
'use strict';
const path = require('path');
const webpack = require('webpack');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const autoprefixer = require('autoprefixer');
module.exports = {
entry: './app/main.jsx',
output: {
path: __dirname,
filename: './public/bundle.js'
},
context: __dirname,
devtool: 'source-map',
resolve: {
extensions: ['', '.js', '.jsx', '.scss', '.json'],
modulesDirectories: [
'node_modules',
path.resolve(__dirname, './node_modules')
]
},
module: {
loaders: [
{
test: /jsx?$/,
exclude: /(node_modules|bower_components)/,
loader: 'babel',
query: {
presets: ['react', 'es2015', 'stage-2']
}
},
{
test: /(\.scss|\.css)$/,
loader: ExtractTextPlugin.extract('style-loader', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?sourceMap')
}
]
},
postcss: [autoprefixer],
plugins: [
new ExtractTextPlugin('/public/stylesheets/bundle.css', {allChunks: true}),
new webpack.optimize.OccurenceOrderPlugin(),
new webpack.NoErrorsPlugin()
]
};