Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added es6 require support #58

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

added es6 require support #58

wants to merge 1 commit into from

Conversation

ghost
Copy link

@ghost ghost commented Sep 30, 2016

Now you can import this polyfill to your project by:
let polyfill = require("./PATH_TO_LIB/classList");

@englishextra
Copy link

englishextra commented Sep 30, 2016

When I use third-party libs in my projects, first thing I do is removing AMD/CJS/Node/es6 wrappers.

So I have for each lib in my custom CDN a file with .fixed.min.js ending.

@ghost
Copy link
Author

ghost commented Sep 30, 2016

Why do you remove theese wrappers, for what??

@englishextra
Copy link

@ivkodenis92 Because of babel/webpack/browserify/electron/nwjs - when you build a crossplatform app - you'd better take control of wrappers on your own.

@ghost
Copy link
Author

ghost commented Sep 30, 2016

It's a simple wrap, why you can't add it? It will be feature for users. Users of any library doesn't want to write any wraps, they want to use ready lib in any comfortable way.

@englishextra
Copy link

englishextra commented Sep 30, 2016

Ok I'll provide example: When you use Masonry/Packery in your webapp it works fine unless you use the source code in Electron env. In electron env the app wont work because of the module wrappers. you have to require Masonry or to remove the wrapper or hide the module. See how much headache you get. If you intend to use require/import - it's alright. When it comes to non import/require implementation - you get more troubles with wrapped out-of-the-box libs. So yes - some want to use already wrapped, and some need clean libs.

You might want to check the story with hiding modules to have a picture what I mean.

@macu
Copy link
Contributor

macu commented Jan 24, 2017

Other projects generate both wrapped and unwrapped final JS files for different uses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants