1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-09-24 04:44:59 +00:00

Fix es5 builds

This commit is contained in:
tobspr
2022-06-16 11:28:37 +02:00
parent bf5199d77a
commit 2e1271ecb7
6 changed files with 41 additions and 21 deletions

View File

@@ -8,6 +8,8 @@ const TerserPlugin = require("terser-webpack-plugin");
const StringReplacePlugin = require("string-replace-webpack-plugin");
const UnusedFilesPlugin = require("unused-files-webpack-plugin").UnusedFilesWebpackPlugin;
const { checkModules, buildExcludeRegexp } = require("are-you-es5");
module.exports = ({
environment,
es6 = false,
@@ -19,6 +21,12 @@ module.exports = ({
wegameVersion = false,
steamDemo = false,
}) => {
const moduleExclusionResult = checkModules({
path: path.join(__dirname, ".."),
checkAllNodeModules: true,
ignoreBabelAndWebpackPackages: true,
});
const globalDefs = {
assert: "false && window.assert",
assertAlways: "window.assert",
@@ -60,7 +68,6 @@ module.exports = ({
// Display bailout reasons
optimizationBailout: true,
},
// devtool: "source-map",
devtool: false,
resolve: {
alias: {
@@ -206,10 +213,7 @@ module.exports = ({
},
{
test: /\.js$/,
exclude: {
and: [/rusha/],
// // not: [/semver/, /query-string/, /yallist/],
},
exclude: buildExcludeRegexp(moduleExclusionResult.es6Modules),
use: [
// "thread-loader",
{
@@ -239,10 +243,7 @@ module.exports = ({
},
{
test: /\.worker\.js$/,
exclude: {
and: [/rusha/],
// // not: [/semver/, /query-string/, /yallist/],
},
exclude: buildExcludeRegexp(moduleExclusionResult.es6Modules),
use: [
{
loader: "worker-loader",