Last active
October 24, 2020 22:33
-
-
Save antony/919660b3cce5c845cd77dff4a211c909 to your computer and use it in GitHub Desktop.
Svelte App on Older Browsers (IE11+)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}] | |
] | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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