-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
62 lines (61 loc) · 1.83 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
entry: {
javascripts: path.resolve(__dirname, './app/main.jsx')
},
output: {
path: path.resolve(__dirname, './assets'),
filename: '[name].js',
publicPath: '/assets/',
chunkFilename: '[id].chunk.js'
},
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel',
exclude: /node_modules/
},
{
test: /\.css$/,
loader: ExtractTextPlugin.extract('style', 'css')
},
{
test: /\.scss$/,
loader: ExtractTextPlugin.extract('style', 'css!autoprefixer!sass')
},
{
test: /\.(png|jpg|gif|svg|eot|ttf|woff|woff2)$/,
loader: 'url?limit=10000'
},
{
test: require.resolve('jquery'),
loader: 'expose?$!expose?jQuery'
},
],
noParse: [
/\/flux.js/,
/\/flux-utils.js/
]
},
plugins: [
new ExtractTextPlugin('styles.css'),
new webpack.optimize.CommonsChunkPlugin({
filename: 'vendor.js',
name: 'vendor'
})
],
resolve: {
extensions: ['', '.js', '.jsx'],
alias: {
'@pages': path.resolve(__dirname, './app/pages'),
'@common': path.resolve(__dirname, './app/common/index'),
'dispatcher': path.resolve(__dirname, './app/dispatcher'),
'flux': path.resolve(__dirname, './app/libs/flux/flux'),
'flux-utils': path.resolve(__dirname, './app/libs/flux/flux-utils')
}
}
//devtool: '#inline-source-map'
};