-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.base.config.js
55 lines (49 loc) · 1.3 KB
/
webpack.base.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
49
50
51
52
53
54
55
const path = require('path');
const autoprefixer = require('autoprefixer');
require('babel-polyfill');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
context: __dirname,
entry: {
signin: './assets/js/index',
members: './assets/js/members/index',
bikes: './assets/js/bikes/index',
babelPolyfill: 'babel-polyfill',
},
output: {
path: path.resolve('./assets/bundles/'),
filename: '[name]-[hash].js',
},
plugins: [
new ExtractTextPlugin('react-toolbox.css', { allChunks: true }),
], // add all common plugins here
module: {
loaders: [
{
test: /\.json$/,
loader: 'json-loader',
},
{
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: ['latest', 'react', 'stage-3'],
plugins: ['transform-runtime'],
},
},
{
test: /(\.scss|\.css)$/,
loader: ExtractTextPlugin.extract('style', 'css?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss!sass?sourceMap!toolbox')
}
],
},
resolve: {
modulesDirectories: [
'node_modules',
'bower_components',
],
extensions: ['', '.js', '.jsx', '.scss'],
},
postcss: [autoprefixer],
};