-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
86 lines (85 loc) · 2.93 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
const webpack = require('webpack');
const path = require('path');
const packageSettings = require("./package.json");
module.exports = {
devtool: 'source-map', // 'cheap-eval-source-map'
context: path.join(__dirname, 'src'),
entry: {
"indexeddb2wrapper": "_index.js"
},
output: {
path: path.resolve(__dirname, "dist"),
filename: "indexeddb2wrapper.js",
library: "indexeddb2wrapper",
libraryTarget: "umd",
umdNamedDefine: true
},
module: {
rules:[
{
enforce: "pre",
test: /\.js$/,
loader: "eslint-loader",
exclude: /node_modules/,
options: {
cache: true,
failOnWarning: false,
failOnError: false,
fix: true
}
},
{
test: /\.js$/,
exclude: /node_modules/,
use:[
{
loader: "babel-loader",
options:{
// https://github.com/babel/babel-loader#options
cacheDirectory: true,
"presets": [
[
"env",
{
//http://www.2ality.com/2015/12/babel6-loose-mode.html
"loose": true,
"modules": false,
"targets": {
"browsers": packageSettings.browserslist
},
useBuiltIns: true
}
]
],
"plugins": [
"babel-plugin-transform-class-properties",
"transform-runtime"
]
}
}
]
}
]
},
target: "web",
resolve: {
mainFiles: ["_index", "index"],
modules: [
path.resolve("./src"),
"node_modules"
]
}/*,
plugins: [
new webpack.optimize.UglifyJsPlugin({
minimize: true,
sourceMap: true,
beautify: false,
comments: false,
compress: {
warnings: true,
drop_debugger: true,
screw_ie8: true
}
})
]*/
};