-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwebpack.config.js
59 lines (56 loc) · 1.47 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
var path = require('path');
var webpack = require('webpack');
var HtmlWebpackPlugin = require("html-webpack-plugin");
var dev_mode = 'development';
// var dev_mode = 'production';
module.exports = {
entry: {
app: './src/main.js',
vendor: [
// "babel-polyfill",
],
},
output: {
path: './dist/js/',
filename: (dev_mode == 'development') ? 'js.min.js' : "[name].[hash].js",
// filename: "[name].[hash].js",
pathinfo: true
},
module: {
loaders: [{
test: /\.js$/,
exclude: /(node_modules|forge\.js)/,
loader: 'babel-loader',
query: {
compact: true,
presets: ['es2015']
}
}]
},
alias: {
forge: 'forge.js'
},
resolve: {
root: [
// path.resolve('./src/app'),
path.resolve('./src/'),
path.resolve('./node_modules/emailjs-imap-client/src/'),
path.resolve('./node_modules/emailjs-imap-handler/src/'),
path.resolve('./node_modules/emailjs-tcp-socket/src/'),
path.resolve('./node_modules/emailjs-smtp-client/src/'),
path.resolve('./node_modules/emailjs-stringencoding/src/'),
]
},
devtool: "eval-cheap-module-source-map", // For save on Coffee script source
plugins: [
new webpack.optimize.CommonsChunkPlugin("vendor", (dev_mode == 'development') ? "vendor.js" : "[name].[hash].js"),
new HtmlWebpackPlugin({
title: "test title",
filename: "../index.html",
template: 'src/index.html'
})
],
node: {
fs: "empty"
}
};