mirror of
https://github.com/wavetermdev/backup.git
synced 2026-08-05 13:57:07 -07:00
packaging with scripthaus-server and mshell binaries, separate dev/prod builds. emain to launch local server from package
This commit is contained in:
+4
-7
@@ -1,11 +1,9 @@
|
||||
const webpack = require('webpack');
|
||||
const merge = require('webpack-merge');
|
||||
const common = require('./webpack.common.js');
|
||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
const LodashModuleReplacementPlugin = require('lodash-webpack-plugin');
|
||||
const moment = require("dayjs");
|
||||
const fs = require("fs");
|
||||
const VERSION = "v0.1.0";
|
||||
const path = require("path");
|
||||
|
||||
function makeBuildStr() {
|
||||
let buildStr = moment().format("YYYYMMDD-HHmmss");
|
||||
@@ -23,8 +21,8 @@ if (process.env.WEBPACK_ANALYZE) {
|
||||
let merged = merge.merge(common, {
|
||||
mode: "production",
|
||||
output: {
|
||||
path: __dirname,
|
||||
filename: "build/hibiki/latest/[name]-prod.min.js"
|
||||
path: path.resolve(__dirname, "dist"),
|
||||
filename: "[name].js",
|
||||
},
|
||||
devtool: "source-map",
|
||||
optimization: {
|
||||
@@ -32,12 +30,11 @@ let merged = merge.merge(common, {
|
||||
},
|
||||
});
|
||||
|
||||
merged.plugins.push(new LodashModuleReplacementPlugin());
|
||||
merged.plugins.push(new MiniCssExtractPlugin({filename: "dist/[name].css", ignoreOrder: true}));
|
||||
if (BundleAnalyzerPlugin != null) {
|
||||
merged.plugins.push(new BundleAnalyzerPlugin());
|
||||
}
|
||||
merged.plugins.push(new webpack.DefinePlugin({
|
||||
__SHDEV__: "false",
|
||||
__SHVERSION__: JSON.stringify(VERSION),
|
||||
__SHBUILD__: JSON.stringify(BUILD),
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user