mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-21 16:52:55 +02:00
prettify, sorry for the big ass commit
This commit is contained in:
+80
-85
@@ -1,96 +1,91 @@
|
||||
/**
|
||||
* Webpack configuration for building unit tests
|
||||
*/
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
var path = require('path');
|
||||
var webpack = require('webpack');
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
var path = require("path");
|
||||
var webpack = require("webpack");
|
||||
|
||||
module.exports = () => {
|
||||
const statsConfig = {
|
||||
builtAt: true,
|
||||
children: false,
|
||||
chunks: false,
|
||||
chunkGroups: false,
|
||||
chunkModules: false,
|
||||
chunkOrigins: false,
|
||||
colors: true,
|
||||
entrypoints: true,
|
||||
}
|
||||
const statsConfig = {
|
||||
builtAt: true,
|
||||
children: false,
|
||||
chunks: false,
|
||||
chunkGroups: false,
|
||||
chunkModules: false,
|
||||
chunkOrigins: false,
|
||||
colors: true,
|
||||
entrypoints: true,
|
||||
};
|
||||
|
||||
return {
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
'process.env.NODE_ENV': "\"development\"",
|
||||
}),
|
||||
new webpack.ProvidePlugin({
|
||||
// Automtically detect jQuery and $ as free var in modules
|
||||
// and inject the jquery library
|
||||
// This is required by many jquery plugins
|
||||
// http://stackoverflow.com/questions/29080148/expose-jquery-to-real-window-object-with-webpack
|
||||
jquery: "jquery",
|
||||
jQuery: "jquery",
|
||||
$: "jquery",
|
||||
}),
|
||||
],
|
||||
entry: "./test/index.js",
|
||||
target: "web",
|
||||
devtool: "source-map",
|
||||
output: {
|
||||
path: path.resolve(__dirname, "./"),
|
||||
filename: "test/test.bundle.js",
|
||||
return {
|
||||
plugins: [
|
||||
new webpack.DefinePlugin({
|
||||
"process.env.NODE_ENV": '"development"',
|
||||
}),
|
||||
new webpack.ProvidePlugin({
|
||||
// Automtically detect jQuery and $ as free var in modules
|
||||
// and inject the jquery library
|
||||
// This is required by many jquery plugins
|
||||
// http://stackoverflow.com/questions/29080148/expose-jquery-to-real-window-object-with-webpack
|
||||
jquery: "jquery",
|
||||
jQuery: "jquery",
|
||||
$: "jquery",
|
||||
}),
|
||||
],
|
||||
entry: "./test/index.js",
|
||||
target: "web",
|
||||
devtool: "source-map",
|
||||
output: {
|
||||
path: path.resolve(__dirname, "./"),
|
||||
filename: "test/test.bundle.js",
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
loader: "ts-loader",
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.tsx?$/,
|
||||
loader: 'ts-loader',
|
||||
exclude: /node_modules/,
|
||||
},
|
||||
{
|
||||
test: /\.(jsx)$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: "babel-loader",
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.s?css$/,
|
||||
loader: 'null-loader',
|
||||
},
|
||||
],
|
||||
{
|
||||
test: /\.(jsx)$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: "babel-loader",
|
||||
},
|
||||
},
|
||||
optimization: {
|
||||
removeAvailableModules: true,
|
||||
removeEmptyChunks: true,
|
||||
mergeDuplicateChunks: true,
|
||||
flagIncludedChunks: true,
|
||||
occurrenceOrder: true,
|
||||
sideEffects: true,
|
||||
providedExports: true,
|
||||
usedExports: true,
|
||||
concatenateModules: false,
|
||||
namedModules: false,
|
||||
namedChunks: false,
|
||||
minimize: false,
|
||||
portableRecords: true,
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
vendor: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
name: `tests/vendor`,
|
||||
chunks: 'all',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.s?css$/,
|
||||
loader: "null-loader",
|
||||
},
|
||||
resolve: {
|
||||
extensions: [
|
||||
".tsx",
|
||||
".ts",
|
||||
".js",
|
||||
".jsx",
|
||||
],
|
||||
],
|
||||
},
|
||||
optimization: {
|
||||
removeAvailableModules: true,
|
||||
removeEmptyChunks: true,
|
||||
mergeDuplicateChunks: true,
|
||||
flagIncludedChunks: true,
|
||||
occurrenceOrder: true,
|
||||
sideEffects: true,
|
||||
providedExports: true,
|
||||
usedExports: true,
|
||||
concatenateModules: false,
|
||||
namedModules: false,
|
||||
namedChunks: false,
|
||||
minimize: false,
|
||||
portableRecords: true,
|
||||
splitChunks: {
|
||||
cacheGroups: {
|
||||
vendor: {
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
name: `tests/vendor`,
|
||||
chunks: "all",
|
||||
},
|
||||
},
|
||||
stats: statsConfig,
|
||||
};
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".tsx", ".ts", ".js", ".jsx"],
|
||||
},
|
||||
stats: statsConfig,
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user