From 088a6a2740db86aefed5ae2145023ef86c325e25 Mon Sep 17 00:00:00 2001 From: Kira Date: Thu, 30 Sep 2021 02:26:05 -0700 Subject: [PATCH] [JS] Try to fully target older browsers --- app/javascript/src/javascripts/posts.js | 1 + babel.config.js | 3 +-- config/webpack/base.js | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/javascript/src/javascripts/posts.js b/app/javascript/src/javascripts/posts.js index 7209a538c..7027eca29 100644 --- a/app/javascript/src/javascripts/posts.js +++ b/app/javascript/src/javascripts/posts.js @@ -966,6 +966,7 @@ Post.disapprove = function(post_id, reason, should_reload) { Post.update_tag_count = function(event) { let string = "0 tags"; let count = 0; + let count2 = 0; if (event) { let tags = [...new Set($(event.target).val().match(/\S+/g))]; diff --git a/babel.config.js b/babel.config.js index 487c2374e..9ebcbcb9e 100644 --- a/babel.config.js +++ b/babel.config.js @@ -25,7 +25,7 @@ module.exports = function (api) { useBuiltIns: 'entry', corejs: '3.8', modules: 'auto', - bugfixes: true, + forceAllTransforms: true, exclude: ['transform-typeof-symbol'] } ], @@ -42,7 +42,6 @@ module.exports = function (api) { ] ].filter(Boolean), plugins: [ - ['@babel/plugin-proposal-class-properties', { loose: true }], ['@babel/plugin-transform-runtime', { helpers: false }], isProductionEnv && moduleExists('babel-plugin-transform-react-remove-prop-types') && [ diff --git a/config/webpack/base.js b/config/webpack/base.js index 0b194b886..c9e39e67e 100644 --- a/config/webpack/base.js +++ b/config/webpack/base.js @@ -16,9 +16,13 @@ const customConfig = { output: { library: ["Danbooru"] }, + optimization: { + runtimeChunk: false + }, externals: { jquery: "jQuery" - } + }, + target: ['web', 'es5'] } module.exports = merge(vueConfig, webpackConfig, customConfig)