Remove source maps and adjust targets
This commit is contained in:
parent
b64bbc8132
commit
c3e0cb5a46
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"presets": ["es2015"]
|
||||||
|
}
|
|
@ -10,7 +10,6 @@ module.exports = function (api) {
|
||||||
loose: true,
|
loose: true,
|
||||||
spec: false,
|
spec: false,
|
||||||
modules: "auto",
|
modules: "auto",
|
||||||
// debug: true
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
|
@ -4,18 +4,24 @@ module.exports = function (api) {
|
||||||
[
|
[
|
||||||
"@babel/preset-env",
|
"@babel/preset-env",
|
||||||
{
|
{
|
||||||
targets: "android >= 4.4.4",
|
targets: "cover 99.5%",
|
||||||
useBuiltIns: "usage",
|
useBuiltIns: "usage",
|
||||||
corejs: 3,
|
corejs: 3,
|
||||||
loose: true,
|
loose: true,
|
||||||
spec: false,
|
spec: false,
|
||||||
modules: "auto",
|
modules: "auto",
|
||||||
// debug: true
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
const plugins = [
|
const plugins = [
|
||||||
"closure-elimination",
|
"closure-elimination",
|
||||||
|
// var is faster than let and const!
|
||||||
|
[
|
||||||
|
"@babel/plugin-transform-block-scoping",
|
||||||
|
{
|
||||||
|
throwIfClosureRequired: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
[
|
[
|
||||||
"@babel/plugin-transform-classes",
|
"@babel/plugin-transform-classes",
|
||||||
{
|
{
|
||||||
|
|
|
@ -61,7 +61,8 @@ module.exports = ({
|
||||||
// Display bailout reasons
|
// Display bailout reasons
|
||||||
optimizationBailout: true,
|
optimizationBailout: true,
|
||||||
},
|
},
|
||||||
devtool: "source-map",
|
// devtool: "source-map",
|
||||||
|
devtool: false,
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"global-compression": path.resolve(__dirname, "..", "src", "js", "core", "lzstring.js"),
|
"global-compression": path.resolve(__dirname, "..", "src", "js", "core", "lzstring.js"),
|
||||||
|
@ -85,7 +86,7 @@ module.exports = ({
|
||||||
minimizer: [
|
minimizer: [
|
||||||
new TerserPlugin({
|
new TerserPlugin({
|
||||||
parallel: true,
|
parallel: true,
|
||||||
sourceMap: true,
|
sourceMap: false,
|
||||||
cache: false,
|
cache: false,
|
||||||
terserOptions: {
|
terserOptions: {
|
||||||
ecma: es6 ? 6 : 5,
|
ecma: es6 ? 6 : 5,
|
||||||
|
@ -178,6 +179,10 @@ module.exports = ({
|
||||||
patterns: ["../src/js/**/*.js"],
|
patterns: ["../src/js/**/*.js"],
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
// new webpack.SourceMapDevToolPlugin({
|
||||||
|
// filename: "[name].map",
|
||||||
|
// publicPath: "/v/" + utils.getRevision() + "/",
|
||||||
|
// }),
|
||||||
// new ReplaceCompressBlocks()
|
// new ReplaceCompressBlocks()
|
||||||
// new webpack.optimize.ModuleConcatenationPlugin()
|
// new webpack.optimize.ModuleConcatenationPlugin()
|
||||||
// new WebpackDeepScopeAnalysisPlugin()
|
// new WebpackDeepScopeAnalysisPlugin()
|
||||||
|
@ -242,13 +247,23 @@ module.exports = ({
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.worker\.js$/,
|
test: /\.worker\.js$/,
|
||||||
use: {
|
use: [
|
||||||
loader: "worker-loader",
|
{
|
||||||
options: {
|
loader: "worker-loader",
|
||||||
fallback: false,
|
options: {
|
||||||
inline: true,
|
fallback: false,
|
||||||
|
inline: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
{
|
||||||
|
loader: "babel-loader?cacheDirectory",
|
||||||
|
options: {
|
||||||
|
configFile: require.resolve(
|
||||||
|
es6 ? "./babel-es6.config.js" : "./babel.config.js"
|
||||||
|
),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.md$/,
|
test: /\.md$/,
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
// We clamp high deltas so 30 fps is fairly ok
|
// We clamp high deltas so 30 fps is fairly ok
|
||||||
const bgFps = 30;
|
var bgFps = 30;
|
||||||
const desiredMsDelay = 1000 / bgFps;
|
var desiredMsDelay = 1000 / bgFps;
|
||||||
|
|
||||||
let lastTick = 0;
|
let lastTick = 0;
|
||||||
|
|
||||||
function tick() {
|
function tick() {
|
||||||
const now = performance.now();
|
var now = performance.now();
|
||||||
const delta = now - lastTick;
|
var delta = now - lastTick;
|
||||||
lastTick = now;
|
lastTick = now;
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
|
Reference in New Issue