-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
webpack.common.js
45 lines (44 loc) · 1.37 KB
/
webpack.common.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
const path = require("path");
const webpack = require("webpack");
const GitRevisionPlugin = require("git-revision-webpack-plugin");
const gitRevisionPlugin = new GitRevisionPlugin({
// branch: true,
});
const CopyWebpackPlugin = require("copy-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
entry: {
app: ["./src/index.ts"]
},
output: {
filename: "[name].bundle.js",
path: path.resolve(__dirname, "dist")
},
plugins: [
gitRevisionPlugin,
new webpack.DefinePlugin({
__VERSION__: JSON.stringify(gitRevisionPlugin.version())
// '__COMMITHASH__': JSON.stringify(gitRevisionPlugin.commithash()),
// '__BRANCH__': JSON.stringify(gitRevisionPlugin.branch()),
}),
new CopyWebpackPlugin([
{ from: "./node_modules/smk2mp4/demo/ffmpeg.js", to: "ffmpeg.js" },
{ from: "./node_modules/smk2mp4/demo/ffmpeg.js.mem", to: "ffmpeg.js.mem" }
]),
new HtmlWebpackPlugin({
meta: {
"apple-mobile-web-app-capable": "yes",
viewport:
"initial-scale=1, maximum-scale=1, user-scalable=no, minimum-scale=1, width=device-width, height=device-height"
},
title: "Anno 2018"
})
],
resolve: {
extensions: [".tsx", ".ts", ".js", ".jsx"]
},
optimization: {
minimizer: [new TerserPlugin()],
},
};