Use babel to support old browser versions up to firefox 52

This commit is contained in:
2023-09-19 14:35:35 +02:00
parent 0063851ef5
commit c9754fafec
4 changed files with 2159 additions and 0 deletions

15
svelte/babel.config.cjs Normal file
View File

@@ -0,0 +1,15 @@
module.exports = function (api) {
api.cache(true);
return {
presets: [
[
"@babel/env",
{
"targets": {
"firefox": "52"
}
}
]
]
};
}

2135
svelte/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -8,6 +8,9 @@
"start": "sirv public" "start": "sirv public"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.22.20",
"@babel/preset-env": "^7.22.20",
"@rollup/plugin-babel": "^6.0.3",
"@rollup/plugin-commonjs": "^25.0.0", "@rollup/plugin-commonjs": "^25.0.0",
"@rollup/plugin-node-resolve": "^15.2.1", "@rollup/plugin-node-resolve": "^15.2.1",
"@rollup/plugin-terser": "^0.4.3", "@rollup/plugin-terser": "^0.4.3",

View File

@@ -3,6 +3,7 @@ import resolve, { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs'; import commonjs from '@rollup/plugin-commonjs';
import livereload from 'rollup-plugin-livereload'; import livereload from 'rollup-plugin-livereload';
import terser from '@rollup/plugin-terser'; import terser from '@rollup/plugin-terser';
import babel from '@rollup/plugin-babel'
const production = !process.env.ROLLUP_WATCH; const production = !process.env.ROLLUP_WATCH;
@@ -37,6 +38,11 @@ export default [
emitCss: false, emitCss: false,
}), }),
babel({
extensions: [".js", ".html", ".svelte"],
babelHelpers: "bundled",
}),
// If you have external dependencies installed from // If you have external dependencies installed from
// npm, you'll most likely need these plugins. In // npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration - // some cases you'll need additional configuration -