This repository has been archived by the owner on Jul 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
webpack.config.js
58 lines (57 loc) · 1.76 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
var path = require('path');
var webpack = require('webpack');
var UnminifiedWebpackPlugin = require('unminified-webpack-plugin');
module.exports = {
watch: true,
context: __dirname + "/app",
entry: [
__dirname + '/app/main.cjsx'
],
module: {
loaders: [
{ test: /\.(babel.js|babel.jsx|es6.js)$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
presets: [ 'es2015-loose', 'babel-preset-stage-2', 'react' ],
plugins: [ 'transform-runtime' ]
}
},
// { test: /\.(jsx|es6.js)$/, exclude: /node_modules/, loaders: ['6to5-loader?optional=coreAliasing'] },
{ test: /\.coffee$/, exclude: /node_modules/, loaders: ['coffee-loader?bare=true'] },
{ test: /\.cjsx$/, loaders: ['coffee', 'cjsx']},
{ test: /\.jade$/, loaders: ['jade'] },
{ test: /\.styl$/, loader: 'style-loader!css-loader!autoprefixer-loader?browsers=last 4 version!stylus-loader?paths=node_modules/' },
{ test: /\.html$/, loader: 'raw-loader' },
{
test: /\.(eot|woff|ttf|svg|png|jpg|wav|mp3)$/,
loader: 'url-loader?limit=30000&name=[name]-[hash].[ext]',
// paths: ['/app/css/i/']
}
]
},
plugins: [
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false
}
}),
new UnminifiedWebpackPlugin()
],
output: {
path: __dirname + '/dist',
filename: 'main.js',
publicPath: 'dist/'
},
resolve: {
root: [path.resolve('./app/'), path.resolve('./app/css/'), path.resolve('./app/partials/')],
moduleDirectories: ['node_modules'],
target: 'node',
extensions: [
'', '.js', 'babel.js', 'babel.jsx', '.jsx', '.es6',
'.styl', '.jade',
'.coffee', '.cjsx',
'.html',
]
}
};