-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebpack.config.js
More file actions
37 lines (36 loc) · 965 Bytes
/
webpack.config.js
File metadata and controls
37 lines (36 loc) · 965 Bytes
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
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
var commonsPlugin = new webpack.optimize.CommonsChunkPlugin('common.js');
var path = require('path');
module.exports = {
plugins: [commonsPlugin,new ExtractTextPlugin('style.css', { allChunks: true })],
entry: {
index:['./src/js/index/index.js'],
nav:['./src/js/nav/nav.js'],
entry:['./src/js/entry.js']
},
output: {
path: path.resolve('build'),
filename: '[name].bundle.js',
},
resolve: {
extensions: ['', '.js', '.jsx']
},
module: {
loaders: [{
test: /\.js$/,
loader: 'babel',
exclude: /node_modules/,
query: {
presets: ['es2015','react']
}
}, {
test: /\.css$/,
loader: 'style!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]'
}]
},
postcss: [
require('autoprefixer'),
require('postcss-color-rebeccapurple')
],
}