forked from tentone/nunuStudio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.prod.js
31 lines (28 loc) · 839 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
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: "none",
mode: "production",
optimization: {minimize: true},
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: {
filename: "bundle.js",
path: output
}
}),
common[1]
];