forked from tentone/nunuStudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.js
35 lines (32 loc) · 908 Bytes
/
webpack.prod.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
const Path = require("path");
const {merge} = require("webpack-merge");
const Webpack = require("webpack");
const {GitRevisionPlugin} = require("git-revision-webpack-plugin");
const common = require("./webpack.config.js");
const git = new GitRevisionPlugin();
const output = Path.resolve(__dirname, "docs/editor");
module.exports = [
merge(common[0], {
devtool: false,
mode: "production",
optimization: {minimize: true},
performance: {
hints: false,
},
plugins: [
new Webpack.DefinePlugin({
"VERSION": JSON.stringify(require("./package.json").version),
"TIMESTAMP": JSON.stringify(new Date().toISOString()),
"REPOSITORY_BRANCH": JSON.stringify(git.branch()),
"REPOSITORY_COMMIT": JSON.stringify(git.commithash()),
"DEVELOPMENT": JSON.stringify(false)
})
],
output: {
hashFunction: "sha256",
filename: "bundle.js",
path: output
}
}),
common[1]
];