Skip to content

Instantly share code, notes, and snippets.

@antony
Last active October 24, 2020 22:33
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save antony/919660b3cce5c845cd77dff4a211c909 to your computer and use it in GitHub Desktop.
Save antony/919660b3cce5c845cd77dff4a211c909 to your computer and use it in GitHub Desktop.
Svelte App on Older Browsers (IE11+)
<!-- generated via npm run build && npx create-polyfill-service-url analyse --file public/bundle.js -->
<script crossorigin="anonymous" src="https://cdn.polyfill.io/v3/polyfill.min.js?features=Array.from,Array.isArray,Array.prototype.entries,Array.prototype.fill,Array.prototype.filter,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.keys,Array.prototype.map,ArrayBuffer,console,DataView,Date.prototype.toISOString,document,fetch,Function.prototype.bind,globalThis,Map,Object.create,Object.defineProperties,Object.defineProperty,Object.entries,Object.getOwnPropertyDescriptor,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.getPrototypeOf,Object.keys,Object.setPrototypeOf,Promise,Reflect,Reflect.construct,Set,Symbol,Symbol.iterator,WeakMap,WeakSet"></script>
import babel from 'rollup-plugin-babel'
...
production && babel({
extensions: ['.js', '.mjs', '.html', '.svelte'],
runtimeHelpers: true,
exclude: [
'node_modules/@babel/**'
],
presets: [
['@babel/preset-env', {
targets: '> 0.25%, not op_mini all'
}]
],
plugins: [
'@babel/plugin-syntax-dynamic-import',
['@babel/plugin-transform-runtime', {
useESModules: true
}]
]
})
npm i -D rollup-plugin-babel @babel/{preset-env,core} @babel/plugin-{syntax-dynamic-import,transform-runtime}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment