mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 23:08:36 +02:00
[chore] Introduce HTML-Webpack
This issue means that any changes to the HTML has to happen in the `.\src\index.html` file rather than the `.\index.html`. This makes the `index.html` in the root now a build artifact the same way that files in `dist\` are.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
var path = require('path');
|
||||
var webpack = require('webpack');
|
||||
var MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
||||
var HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||
|
||||
module.exports = (env, argv) => ({
|
||||
plugins: [
|
||||
@@ -16,6 +17,42 @@ module.exports = (env, argv) => ({
|
||||
jQuery: "jquery",
|
||||
$: "jquery"
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
title: "Bitburner" + (argv.mode === 'development' ? ' - development' : ""),
|
||||
template: "src/index.html",
|
||||
favicon: "favicon.ico",
|
||||
meta: {},
|
||||
minify: argv.mode === 'development' ? false : {
|
||||
collapseBooleanAttributes: true,
|
||||
collapseInlineTagWhitespace: false,
|
||||
collapseWhitespace: false,
|
||||
conservativeCollapse: false,
|
||||
html5: true,
|
||||
includeAutoGeneratedTags: false,
|
||||
keepClosingSlash: true,
|
||||
minifyCSS: false,
|
||||
minifyJS: false,
|
||||
minifyURLs: false,
|
||||
preserveLineBreaks: false,
|
||||
preventAttributesEscaping: false,
|
||||
processConditionalComments: false,
|
||||
quoteCharacter: "\"",
|
||||
removeAttributeQuotes: false,
|
||||
removeComments: false,
|
||||
removeEmptyAttributes: false,
|
||||
removeEmptyElements: false,
|
||||
removeOptionalTags: false,
|
||||
removeScriptTypeAttributes: false,
|
||||
removeStyleLinkTypeAttributes: false,
|
||||
removeTagWhitespace: false,
|
||||
sortAttributes: false,
|
||||
sortClassName: false,
|
||||
useShortDoctype: false
|
||||
},
|
||||
excludeChunks: [
|
||||
"tests/tests"
|
||||
]
|
||||
}),
|
||||
new MiniCssExtractPlugin({
|
||||
filename: "[name].css",
|
||||
chunkFilename: "[id].css"
|
||||
|
||||
Reference in New Issue
Block a user