Fix es5 builds
This commit is contained in:
parent
bf5199d77a
commit
2e1271ecb7
|
@ -14,18 +14,18 @@ module.exports = function (api) {
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
const plugins = [
|
const plugins = [
|
||||||
// "closure-elimination",
|
"closure-elimination",
|
||||||
// var is faster than let and const!
|
// var is faster than let and const!
|
||||||
// [
|
[
|
||||||
// "@babel/plugin-transform-block-scoping",
|
"@babel/plugin-transform-block-scoping",
|
||||||
// {
|
{
|
||||||
// throwIfClosureRequired: false,
|
throwIfClosureRequired: false,
|
||||||
// },
|
},
|
||||||
// ],
|
],
|
||||||
[
|
[
|
||||||
"@babel/plugin-transform-classes",
|
"@babel/plugin-transform-classes",
|
||||||
{
|
{
|
||||||
loose: false,
|
loose: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
@ -33,10 +33,9 @@ module.exports = function (api) {
|
||||||
presets,
|
presets,
|
||||||
plugins,
|
plugins,
|
||||||
highlightCode: true,
|
highlightCode: true,
|
||||||
sourceType: "module",
|
sourceType: "unambiguous",
|
||||||
sourceMaps: false,
|
sourceMaps: false,
|
||||||
parserOpts: {},
|
parserOpts: {},
|
||||||
// only: ["../src/js"],
|
|
||||||
generatorOpts: {
|
generatorOpts: {
|
||||||
retainLines: false,
|
retainLines: false,
|
||||||
compact: true,
|
compact: true,
|
||||||
|
|
|
@ -29,7 +29,7 @@ module.exports = {
|
||||||
try {
|
try {
|
||||||
return execSync("git describe --tag --exact-match").toString("ascii");
|
return execSync("git describe --tag --exact-match").toString("ascii");
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new Error('Current git HEAD is not a version tag');
|
throw new Error("Current git HEAD is not a version tag");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
"@types/filesystem": "^0.0.29",
|
"@types/filesystem": "^0.0.29",
|
||||||
"@types/node": "^12.7.5",
|
"@types/node": "^12.7.5",
|
||||||
"ajv": "^6.10.2",
|
"ajv": "^6.10.2",
|
||||||
|
"are-you-es5": "^2.1.2",
|
||||||
"audiosprite": "^0.7.2",
|
"audiosprite": "^0.7.2",
|
||||||
"babel-core": "^6.26.3",
|
"babel-core": "^6.26.3",
|
||||||
"babel-loader": "^8.1.0",
|
"babel-loader": "^8.1.0",
|
||||||
|
|
|
@ -8,6 +8,8 @@ const TerserPlugin = require("terser-webpack-plugin");
|
||||||
const StringReplacePlugin = require("string-replace-webpack-plugin");
|
const StringReplacePlugin = require("string-replace-webpack-plugin");
|
||||||
const UnusedFilesPlugin = require("unused-files-webpack-plugin").UnusedFilesWebpackPlugin;
|
const UnusedFilesPlugin = require("unused-files-webpack-plugin").UnusedFilesWebpackPlugin;
|
||||||
|
|
||||||
|
const { checkModules, buildExcludeRegexp } = require("are-you-es5");
|
||||||
|
|
||||||
module.exports = ({
|
module.exports = ({
|
||||||
environment,
|
environment,
|
||||||
es6 = false,
|
es6 = false,
|
||||||
|
@ -19,6 +21,12 @@ module.exports = ({
|
||||||
wegameVersion = false,
|
wegameVersion = false,
|
||||||
steamDemo = false,
|
steamDemo = false,
|
||||||
}) => {
|
}) => {
|
||||||
|
const moduleExclusionResult = checkModules({
|
||||||
|
path: path.join(__dirname, ".."),
|
||||||
|
checkAllNodeModules: true,
|
||||||
|
ignoreBabelAndWebpackPackages: true,
|
||||||
|
});
|
||||||
|
|
||||||
const globalDefs = {
|
const globalDefs = {
|
||||||
assert: "false && window.assert",
|
assert: "false && window.assert",
|
||||||
assertAlways: "window.assert",
|
assertAlways: "window.assert",
|
||||||
|
@ -60,7 +68,6 @@ module.exports = ({
|
||||||
// Display bailout reasons
|
// Display bailout reasons
|
||||||
optimizationBailout: true,
|
optimizationBailout: true,
|
||||||
},
|
},
|
||||||
// devtool: "source-map",
|
|
||||||
devtool: false,
|
devtool: false,
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
|
@ -206,10 +213,7 @@ module.exports = ({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
exclude: {
|
exclude: buildExcludeRegexp(moduleExclusionResult.es6Modules),
|
||||||
and: [/rusha/],
|
|
||||||
// // not: [/semver/, /query-string/, /yallist/],
|
|
||||||
},
|
|
||||||
use: [
|
use: [
|
||||||
// "thread-loader",
|
// "thread-loader",
|
||||||
{
|
{
|
||||||
|
@ -239,10 +243,7 @@ module.exports = ({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.worker\.js$/,
|
test: /\.worker\.js$/,
|
||||||
exclude: {
|
exclude: buildExcludeRegexp(moduleExclusionResult.es6Modules),
|
||||||
and: [/rusha/],
|
|
||||||
// // not: [/semver/, /query-string/, /yallist/],
|
|
||||||
},
|
|
||||||
use: [
|
use: [
|
||||||
{
|
{
|
||||||
loader: "worker-loader",
|
loader: "worker-loader",
|
||||||
|
|
|
@ -1240,6 +1240,11 @@ acorn@^6.0.1, acorn@^6.0.2, acorn@^6.0.7, acorn@^6.4.1:
|
||||||
resolved "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz"
|
resolved "https://registry.npmjs.org/acorn/-/acorn-6.4.1.tgz"
|
||||||
integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==
|
integrity sha512-ZVA9k326Nwrj3Cj9jlh3wGFutC2ZornPNARZwsNYqQYgN0EsV2d53w5RN/co65Ohn4sUAUtb1rSUAOD6XN9idA==
|
||||||
|
|
||||||
|
acorn@^6.0.6:
|
||||||
|
version "6.4.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.4.2.tgz#35866fd710528e92de10cf06016498e47e39e1e6"
|
||||||
|
integrity sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==
|
||||||
|
|
||||||
after@0.8.2:
|
after@0.8.2:
|
||||||
version "0.8.2"
|
version "0.8.2"
|
||||||
resolved "https://registry.npmjs.org/after/-/after-0.8.2.tgz"
|
resolved "https://registry.npmjs.org/after/-/after-0.8.2.tgz"
|
||||||
|
@ -1465,6 +1470,16 @@ archy@^1.0.0:
|
||||||
resolved "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz"
|
resolved "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz"
|
||||||
integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=
|
integrity sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=
|
||||||
|
|
||||||
|
are-you-es5@^2.1.2:
|
||||||
|
version "2.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/are-you-es5/-/are-you-es5-2.1.2.tgz#d75511a174a3f842d70cc784aec0bcaff5a57547"
|
||||||
|
integrity sha512-gkT2bLCfzyJJr3lYoxZKScdD/Yp5zzghi+3KawONTvH/7rrgU3RMXYvGQnOTlqEFVgZFpEGj/6bZ6sF/9YtddA==
|
||||||
|
dependencies:
|
||||||
|
acorn "^6.0.6"
|
||||||
|
array-flatten "^2.1.0"
|
||||||
|
commander "^2.19.0"
|
||||||
|
find-up "^4.1.0"
|
||||||
|
|
||||||
argparse@^1.0.7:
|
argparse@^1.0.7:
|
||||||
version "1.0.10"
|
version "1.0.10"
|
||||||
resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz"
|
resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz"
|
||||||
|
@ -1534,6 +1549,11 @@ array-find-index@^1.0.1:
|
||||||
resolved "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz"
|
resolved "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz"
|
||||||
integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=
|
integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=
|
||||||
|
|
||||||
|
array-flatten@^2.1.0:
|
||||||
|
version "2.1.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-2.1.2.tgz#24ef80a28c1a893617e2149b0c6d0d788293b099"
|
||||||
|
integrity sha512-hNfzcOV8W4NdualtqBFPyVO+54DSJuZGY9qT4pRroB6S9e3iiido2ISIC5h9R2sPJ8H3FHCIiEnsv1lPXO3KtQ==
|
||||||
|
|
||||||
array-initial@^1.0.0:
|
array-initial@^1.0.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz"
|
resolved "https://registry.npmjs.org/array-initial/-/array-initial-1.1.0.tgz"
|
||||||
|
|
|
@ -38,7 +38,6 @@ export function getLogoSprite() {
|
||||||
|
|
||||||
const essentialMainMenuSprites = [getLogoSprite()];
|
const essentialMainMenuSprites = [getLogoSprite()];
|
||||||
|
|
||||||
console.warn("UI: ", G_ALL_UI_IMAGES);
|
|
||||||
const essentialMainMenuSounds = [
|
const essentialMainMenuSounds = [
|
||||||
SOUNDS.uiClick,
|
SOUNDS.uiClick,
|
||||||
SOUNDS.uiError,
|
SOUNDS.uiError,
|
||||||
|
|
Loading…
Reference in New Issue