mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-12-18 20:25:45 +01:00
Merge pull request #3221 from MartinFournier/chore/move-bundle
Move main bundle output to ./dist subfolder
This commit is contained in:
commit
59bcf4d695
@ -123,7 +123,7 @@
|
|||||||
"test:watch": "jest --watch",
|
"test:watch": "jest --watch",
|
||||||
"watch": "webpack --watch --mode production",
|
"watch": "webpack --watch --mode production",
|
||||||
"watch:dev": "webpack --watch --mode development",
|
"watch:dev": "webpack --watch --mode development",
|
||||||
"electron": "sh ./package.sh",
|
"electron": "sh ./tools/package-electron.sh",
|
||||||
"electron:packager": "electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png --no-prune",
|
"electron:packager": "electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png --no-prune",
|
||||||
"electron:packager-all": "electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png",
|
"electron:packager-all": "electron-packager .package bitburner --all --out .build --overwrite --icon .package/icon.png",
|
||||||
"electron:packager-win": "electron-packager .package bitburner --platform win32 --arch x64 --out .build --overwrite --icon .package/icon.png",
|
"electron:packager-win": "electron-packager .package bitburner --platform win32 --arch x64 --out .build --overwrite --icon .package/icon.png",
|
||||||
|
31
package.sh
31
package.sh
@ -1,31 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# Clear out any files remaining from old builds
|
|
||||||
rm -rf .package
|
|
||||||
|
|
||||||
mkdir -p .package/dist/src/ThirdParty || true
|
|
||||||
mkdir -p .package/src/ThirdParty || true
|
|
||||||
mkdir -p .package/node_modules || true
|
|
||||||
|
|
||||||
cp index.html .package
|
|
||||||
cp -r electron/* .package
|
|
||||||
cp -r dist/ext .package/dist
|
|
||||||
cp -r dist/icons .package/dist
|
|
||||||
cp -r dist/images .package/dist
|
|
||||||
|
|
||||||
# The js files.
|
|
||||||
cp dist/vendor.bundle.js .package/dist/vendor.bundle.js
|
|
||||||
cp main.bundle.js .package/main.bundle.js
|
|
||||||
|
|
||||||
# Source maps
|
|
||||||
cp dist/vendor.bundle.js.map .package/dist/vendor.bundle.js.map
|
|
||||||
cp main.bundle.js.map .package/main.bundle.js.map
|
|
||||||
|
|
||||||
# Install electron sub-dependencies
|
|
||||||
cd electron
|
|
||||||
npm install
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
BUILD_PLATFORM="${1:-"all"}"
|
|
||||||
# And finally build the app.
|
|
||||||
npm run electron:packager-$BUILD_PLATFORM
|
|
22
tools/package-electron.sh
Normal file
22
tools/package-electron.sh
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -euxo pipefail
|
||||||
|
|
||||||
|
# Clear out any files remaining from old builds
|
||||||
|
rm -rf .package
|
||||||
|
|
||||||
|
mkdir -p .package/dist/ || true
|
||||||
|
|
||||||
|
cp index.html .package
|
||||||
|
cp favicon.ico .package
|
||||||
|
cp -r electron/* .package
|
||||||
|
cp -r dist .package
|
||||||
|
|
||||||
|
# Install electron sub-dependencies
|
||||||
|
cd electron
|
||||||
|
npm install
|
||||||
|
cd ..
|
||||||
|
|
||||||
|
BUILD_PLATFORM="${1:-"all"}"
|
||||||
|
# And finally build the app.
|
||||||
|
npm run electron:packager-$BUILD_PLATFORM
|
@ -63,6 +63,7 @@ module.exports = (env, argv) => {
|
|||||||
new HtmlWebpackPlugin({
|
new HtmlWebpackPlugin({
|
||||||
title: "Bitburner",
|
title: "Bitburner",
|
||||||
template: "src/index.html",
|
template: "src/index.html",
|
||||||
|
filename: "../index.html",
|
||||||
favicon: "favicon.ico",
|
favicon: "favicon.ico",
|
||||||
googleAnalytics: {
|
googleAnalytics: {
|
||||||
trackingId: "UA-100157497-1",
|
trackingId: "UA-100157497-1",
|
||||||
@ -136,7 +137,7 @@ module.exports = (env, argv) => {
|
|||||||
// },
|
// },
|
||||||
entry: entry,
|
entry: entry,
|
||||||
output: {
|
output: {
|
||||||
path: path.resolve(__dirname, "./"),
|
path: path.resolve(__dirname, outputDirectory),
|
||||||
filename: "[name].bundle.js",
|
filename: "[name].bundle.js",
|
||||||
},
|
},
|
||||||
module: {
|
module: {
|
||||||
@ -161,7 +162,7 @@ module.exports = (env, argv) => {
|
|||||||
loader: "file-loader",
|
loader: "file-loader",
|
||||||
options: {
|
options: {
|
||||||
name: "[contenthash].[ext]",
|
name: "[contenthash].[ext]",
|
||||||
outputPath: "dist/images",
|
outputPath: "images",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -184,7 +185,7 @@ module.exports = (env, argv) => {
|
|||||||
cacheGroups: {
|
cacheGroups: {
|
||||||
vendor: {
|
vendor: {
|
||||||
test: /[\\/]node_modules[\\/]/,
|
test: /[\\/]node_modules[\\/]/,
|
||||||
name: `${outputDirectory}/vendor`,
|
name: `vendor`,
|
||||||
chunks: "all",
|
chunks: "all",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user