Move main bundle output to ./dist subfolder

Excludes the index.html so that the github page can still work as is.

This will declutter the root of the repo a fair bit.
This commit is contained in:
Martin Fournier 2022-01-26 06:01:08 -05:00
parent 022dd5d7d7
commit 069b7831d1
4 changed files with 8 additions and 25 deletions

1
.gitignore vendored

@ -5,7 +5,6 @@ Netburner.txt
/doc/build
/node_modules
/electron/node_modules
/dist/*.map
/test/*.map
/test/*.bundle.*
/test/*.css

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

@ -3,27 +3,10 @@
# 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
mkdir -p .package/dist/
cp -r electron/* .package
cp -r dist/ext .package/dist
cp -r dist/icons .package/dist
cp -r dist/images .package/dist
# The css files
cp dist/vendor.css .package/dist
cp main.css .package/main.css
# 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
cp -r dist .package
cp index.html .package/index.html
# Install electron sub-dependencies
cd electron

@ -63,7 +63,8 @@ module.exports = (env, argv) => {
new HtmlWebpackPlugin({
title: "Bitburner",
template: "src/index.html",
favicon: "favicon.ico",
filename: "../index.html",
favicon: "assets/favicon.ico",
googleAnalytics: {
trackingId: "UA-100157497-1",
},
@ -136,7 +137,7 @@ module.exports = (env, argv) => {
// },
entry: entry,
output: {
path: path.resolve(__dirname, "./"),
path: path.resolve(__dirname, outputDirectory),
filename: "[name].bundle.js",
},
module: {
@ -161,7 +162,7 @@ module.exports = (env, argv) => {
loader: 'file-loader',
options: {
name: '[contenthash].[ext]',
outputPath: 'dist/images',
outputPath: 'images',
},
},
],
@ -184,7 +185,7 @@ module.exports = (env, argv) => {
cacheGroups: {
vendor: {
test: /[\\/]node_modules[\\/]/,
name: `${outputDirectory}/vendor`,
name: `vendor`,
chunks: "all",
},
},