Import ES6 code without polyfills (again)
See original GitHub issuehttps://github.com/jshjohnson/Choices/issues/480 brought great improvements to bundle size (thanks!).
To decrease it even further I would like to exclude polyfills as discussed in https://github.com/jshjohnson/Choices/issues/117 and https://github.com/jshjohnson/Choices/issues/144.
As I understand it the entry point for importing the ES6 code is
https://github.com/jshjohnson/Choices/blob/master/src/scripts/choices.js. However that file includes import './lib/polyfills';
.
Would it be an option to leave that out and create another file that imported choices.js
and lib/polyfills.js
? That file could then be the one that was transpiled, catering both for users that needs the pre-built files and users that would like to import just the source code.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Shipping ES6 in browsers without Polyfill | by Arnav Yagnik
In today's world and age as web developers, we understand that there is a need to ship minimal JavaScript to a user's browser....
Read more >16. Modules - Exploring JS
The imports of an ES6 module are read-only views on the exported entities. That means that the connections to variables declared inside module...
Read more >how to make webpack import polyfills only for a specific build?
I just managed to make webpack create two separete builds one for es5 and another for es6. See below the config ...
Read more >Plans for ES6 module support? · Issue #385 · zloirock/core-js
I was trying to get this to work with import statements and Rollup, so that our app would only include the parts of...
Read more >ES2020: `import()` – dynamically importing ES modules - 2ality
ECMAScript modules are completely static: you must specify what you import and export at compile time and can't react to changes at runtime....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jshjohnson The polyfill is actually available on their service. Add
CustomEvent
in the list of polyfills to load.(Missed that you already had removed the others)