-
Notifications
You must be signed in to change notification settings - Fork 1
/
webpack.config.js
63 lines (49 loc) · 1.23 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
//
// WebPack config file
const pkg = require("./package.json")
const webpack = require('webpack');
module.exports = {
plugins: [],
module: {
rules: []
}
}
// The app's starting file
module.exports.entry = [
/** Polyfills for HF */
"core-js/fn/function",
"core-js/fn/object",
"core-js/fn/symbol",
"core-js/fn/array",
"core-js/fn/date",
/** App main */
"./src/start.js"
];
// The final app's JS output file
module.exports.output = {
path: __dirname + "/dist/",
filename: pkg.name + ".hfscript.js",
libraryTarget:"var",
library:"HFScript"
}
// Compile support for ES6 classes etc
module.exports.module.rules.push({
test: /\.js$/,
exclude: /node_modules/,
rules: [
// Compile down to old-style JavaScript
{
loader: 'babel-loader',
options: {
presets: [require("babel-preset-env")],
}
}
]
})
module.exports.module.rules.push({
test: /(\.png|\.svg|\.jpg)$/,
loader: "url-loader"
})
// Fix High Fidelity's ES3 issues, and return the library at the end
const HighFidelityWebpackPlugin = require("./HighFidelityWebpackPlugin")
module.exports.plugins.push(new HighFidelityWebpackPlugin())