question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import ES6 code without polyfills (again)

See original GitHub issue

https://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:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
stofcommented, Feb 28, 2019

@jshjohnson The polyfill is actually available on their service. Add CustomEvent in the list of polyfills to load.

1reaction
perifercommented, Feb 20, 2019

(Missed that you already had removed the others)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found