This repository has been archived by the owner on Jan 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.common.js
54 lines (53 loc) · 1.56 KB
/
webpack.common.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
const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const sources = path.join(__dirname, '/app/main.js')
process.traceDeprecation = true;
module.exports = {
devtool: 'eval-source-map',
entry: ['whatwg-fetch','babel-polyfill',
sources
],
output: {
path: path.join(__dirname, '/dist/'),
filename: '[name].js',
publicPath: '/'
},
plugins: [
new HtmlWebpackPlugin({
template: 'app/index.tpl.html',
inject: 'body',
filename: 'index.html'
}),
new webpack.NoEmitOnErrorsPlugin(),
],
resolve: {
extensions: ['.js', '.jsx', '.css']
},
module: {
loaders: [ {
test: /\.jsx?$/,
exclude: /node_modules/,
loader: 'babel-loader',
query: {
"presets": ["es2015", "react","stage-0"]
},
include: __dirname
}, {
test: /\.json?$/,
loader: 'json-loader',
include: __dirname
}, {
test: [/\.css$/,/\.less$/],
loaders: [ 'style-loader', 'css-loader', 'less-loader' ],
include: __dirname
}, {
test: /\.(png|jpg|svg|woff|woff2)?(\?v=\d+.\d+.\d+)?$/,
loader: 'url-loader?limit=8192'
}, {
test: /\.(eot|ttf)$/,
loader: 'file-loader'
}
]
}
};