/
webpack.config.js
55 lines (47 loc) · 1.46 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
/**
* Webpack Config for Forcify Build.
* created by @huxpro
*/
var webpack = require('webpack');
var path = require('path');
var buildPath = path.resolve(__dirname, 'dist');
var nodeModulesPath = path.resolve(__dirname, 'node_modules');
var outputFileName = process.env.MODE == 'dev' ?
"forcify.debug.js" :
"forcify.min.js"
var config = {
entry: [
path.join(__dirname, '/src/forcify.js')
],
output: {
path: buildPath, //Path of output file
filename: outputFileName, //Name of output file
library: 'Forcify', //Library Name
libraryTarget: 'umd' //Target format
},
resolve: {
extensions: ["", ".js", ".jsx"]
//node_modules: ["web_modules", "node_modules"] (Default Settings)
},
plugins: (process.env.MODE == 'dev')? [] : [
//Minify the bundle
new webpack.optimize.UglifyJsPlugin({
compress: {
warnings: false,
drop_console: true
}
}),
//Allows error warnings but does not stop compiling. Will remove when eslint is added
new webpack.NoErrorsPlugin()
],
module: {
loaders: [
{
test: /\.(js|jsx)$/, //All .js and .jsx files
loader: 'babel-loader?stage=0',
exclude: [nodeModulesPath]
}
]
},
};
module.exports = config;