-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.dev.js
51 lines (43 loc) · 1015 Bytes
/
webpack.dev.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
const path = require('path')
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin')
const webpack = require('webpack')
const DIST = path.resolve(__dirname, 'dist')
const SRC = path.resolve(__dirname, 'src')
const IS_DEVELOPMENT = process.env.NODE_ENV === 'development'
process.env.DEBUG = IS_DEVELOPMENT
const SLOW_AND_ACCURATE_SOURCE = 'source-map'
const FAST_SOURCE = 'cheap-module-eval-source-map '
module.exports = {
target: "web",
devtool: false,
module: {
rules: [{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
}]
},
plugins: [
new webpack.EnvironmentPlugin(['NODE_ENV', 'DEBUG']),
new CleanWebpackPlugin(DIST),
// new UglifyJSPlugin()
],
entry: {
jsend: "./src/JSend.js"
},
output: {
filename: '[name].js',
path: DIST,
library: 'jsend-client',
libraryTarget: "umd"
},
resolve: {
modules: [
SRC,
"node_modules"
]
},
watch: IS_DEVELOPMENT,
mode: process.env.NODE_ENV
}