2021-04-16 21:49:17 +08:00
|
|
|
const path = require('path');
|
2022-04-09 18:10:03 +08:00
|
|
|
const TerserPlugin = require("terser-webpack-plugin");
|
|
|
|
const LicenseWebpackPlugin = require('license-webpack-plugin').LicenseWebpackPlugin;
|
2017-08-22 15:58:15 +08:00
|
|
|
|
2022-11-27 07:21:59 +08:00
|
|
|
var devtool;
|
|
|
|
|
|
|
|
if (process.env.DEV === '1') {
|
|
|
|
devtool = 'inline-source-map';
|
|
|
|
} else {
|
|
|
|
devtool = 'source-map';
|
|
|
|
}
|
|
|
|
|
2017-05-22 07:16:24 +08:00
|
|
|
module.exports = {
|
|
|
|
entry: "./src/main.ts",
|
2021-04-16 21:49:17 +08:00
|
|
|
entry: {
|
|
|
|
"gotty": "./src/main.ts",
|
|
|
|
},
|
2017-05-22 07:16:24 +08:00
|
|
|
output: {
|
2021-04-16 21:49:17 +08:00
|
|
|
path: path.resolve(__dirname, '../bindata/static/js/'),
|
2017-05-22 07:16:24 +08:00
|
|
|
},
|
2022-11-27 07:21:59 +08:00
|
|
|
devtool: devtool,
|
2017-05-22 07:16:24 +08:00
|
|
|
resolve: {
|
|
|
|
extensions: [".ts", ".tsx", ".js"],
|
|
|
|
},
|
2022-04-09 18:10:03 +08:00
|
|
|
plugins: [
|
|
|
|
new LicenseWebpackPlugin()
|
|
|
|
],
|
2017-05-22 07:16:24 +08:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
test: /\.tsx?$/,
|
|
|
|
loader: "ts-loader",
|
2017-08-23 09:58:18 +08:00
|
|
|
exclude: /node_modules/
|
|
|
|
},
|
2021-04-16 21:49:17 +08:00
|
|
|
{
|
|
|
|
test: /\.css$/i,
|
|
|
|
use: ["style-loader", "css-loader"],
|
|
|
|
},
|
2017-08-23 09:58:18 +08:00
|
|
|
{
|
2022-04-09 18:10:03 +08:00
|
|
|
test: /\.scss$/i,
|
|
|
|
use: ["style-loader", "css-loader", {
|
|
|
|
loader: "sass-loader",
|
|
|
|
options: {
|
|
|
|
sassOptions: {
|
|
|
|
includePaths: ["node_modules/bootstrap/scss"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
2021-04-16 21:49:17 +08:00
|
|
|
},
|
|
|
|
],
|
2017-08-22 15:58:15 +08:00
|
|
|
},
|
2022-04-09 18:10:03 +08:00
|
|
|
optimization: {
|
|
|
|
minimize: true,
|
|
|
|
minimizer: [new TerserPlugin()],
|
|
|
|
},
|
2017-05-22 07:16:24 +08:00
|
|
|
};
|