Skip to content

Instantly share code, notes, and snippets.

@antony
Last active Oct 24, 2020
Embed
What would you like to do?
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