https://mvolkmann.github.io/blog/svelte/supporting-ie11/
<script defer src="<https://polyfill.io/v3/polyfill.min.js>"></script>
babel({
babelHelpers: 'runtime',
extensions: ['.js', '.mjs', '.html', '.svelte'],
exclude: ['node_modules/@babel/**', 'node_modules/core-js/**'],
presets: [
[
'@babel/preset-env',
{
targets: {
ie: '11'
},
useBuiltIns: 'usage',
corejs: 3
}
]
],
plugins: [
'@babel/plugin-syntax-dynamic-import',
[
'@babel/plugin-transform-runtime',
{
useESModules: true
}
]
]
}),
npm install --save @babel/core @babel/runtime
npm install --save babel
npm install --save @babel/node
npm install --save @babel/plugin-syntax-dynamic-import
npm install --save @babel/plugin-transform-runtime
npm install --save @babel/preset-env
npm install --save @babel/plugin-syntax-dynamic-import @babel/plugin-transform-runtime @babel/runtime @rollup/plugin-babel corejs whatwg-fetch
npm install --save sveltestrap
npm install --save svelte-spa-router
npm install --save rollup-plugin-postcss
In each source file where the Fetch API is being used, add the following:
import 'whatwg-fetch';