forked from alfredkam/alfredkam.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
77 lines (66 loc) · 1.8 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
require('babel-core/register')({
ignore: /(node_modules|__tests__)/,
optional : [
'es7.asyncFunctions',
'es7.classProperties',
'es7.comprehensions',
'es7.decorators',
'es7.doExpressions',
'es7.exponentiationOperator',
'es7.exportExtensions',
'es7.objectRestSpread',
'es7.trailingFunctionCommas'
],
blacklist: ['strict'],
extensions: [".es6", ".es", ".jsx", ".es6.js", ".js" ]
});
var path = require('path');
var webpack = require('webpack');
var ExtractTextPlugin = require('extract-text-webpack-plugin');
module.exports = {
context: __dirname,
entry: {
app: './src/App.js',
vendor: ['prismjs', 'zepto']
},
devtool: 'source-map',
output: {
path: path.join(__dirname, 'static/scripts'),
filename: '[name].js'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoErrorsPlugin(),
new ExtractTextPlugin('styles.css')
],
resolve: {
alias: {
"zepto": "zepto/zepto.min.js", // var $ = require('zepto')
}
},
module: {
preLoaders: [
{
test: /\.js$/,
loader: "source-map-loader"
}
],
loaders: [
{ test: /zepto(\.min)?\.js$/, loader: "exports?Zepto; delete window.$; delete window.Zepto;" },
{
test: /\.jsx$/,
loaders: ['jsx-loader?harmony']
},
{
test: /\.(es6|js)$/,
loader: 'babel-loader?stage=0&blacklist=useStrict'
},
{ test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader', 'autoprefixer-loader')},
{ test: /\.less$/, loader: ExtractTextPlugin.extract( 'css?sourceMap!less?sourceMap!autoprefixer-loader')},
{ test: /\.json$/, loaders: [ 'json-loader' ] },
{
test: /\.(woff|ttf|eot|svg)$/, loader: 'file-loader'
}
]
}
};