-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwebpack.config.js
37 lines (34 loc) · 925 Bytes
/
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
'use strict';
var path = require('path');
var webpack = require('webpack');
const APP_FILENAME = 'index';
const ROOT_PATH = path.resolve(__dirname);
const APP_PATH = path.resolve(ROOT_PATH, 'example/src/' + APP_FILENAME + '.js');
const BUILD_PATH = path.resolve(ROOT_PATH, 'example/dist/');
module.exports = {
entry: APP_PATH,
output: {
path: BUILD_PATH,
publicPath: BUILD_PATH + '/',
filename: APP_FILENAME + '.js',
},
module: {
loaders: [
{
test: /\.js$/,
loaders: ['babel-loader'],
include: path.join(__dirname, ''),
},
{
test: /\.css$/,
loader: 'style-loader!css-loader',
},
],
},
plugins: [
new webpack.DefinePlugin({
'process.env': { NODE_ENV: JSON.stringify('production') },
}),
new webpack.optimize.UglifyJsPlugin({ comments: false }),
],
};