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

Polymer 2.0 Build Permutations and Improvements #2315

Closed
10 of 13 tasks
FredKSchott opened this issue Dec 12, 2016 · 5 comments
Closed
10 of 13 tasks

Polymer 2.0 Build Permutations and Improvements #2315

FredKSchott opened this issue Dec 12, 2016 · 5 comments

Comments

@FredKSchott
Copy link
Contributor

@FredKSchott FredKSchott self-assigned this Dec 12, 2016
@yordis
Copy link

yordis commented Dec 16, 2016

@FredKSchott will this allow me to add .babelrc in my project and it will use it? So I can add babel-preset-env if I want.

Also, could you add autoprefixer and allow me to add the browserlist in my project so I can configure the output?

@yordis
Copy link

yordis commented Dec 16, 2016

Btw, it will be great if I can define either babelrc or browserlist in the command line so we can support multiple builds. Example: polymer build --babelrc="path/here" --browserlist="path/here"

For example, one of my case I have to support IE11, but I don't want to ship the same version of the Javascript file for the modern browsers. They have almost 100% of ES6 support, so the trade off is big 😢

@FredKSchott
Copy link
Contributor Author

FredKSchott commented Dec 20, 2016

@yordis supporting multiple builds is the plan (see list above).

Once this is done we can look into supporting the ability to pass in your own .babelrc file. We really want to support that, but it's a bit of a foot-gun because the modules transform that is a part of es2015 preset causes a breaking change to the top-level scope of each file.

@yordis
Copy link

yordis commented Dec 21, 2016

@FredKSchott I didn't understand the concern about the module transform.

Also, you don't need to even pass the .babelrc as a parameter, you could check the pwd for the .babelrc but if I am not mistaking with the proper Babel setup it should do it for you.

This is the Babel code
https://github.com/babel/babel/blob/9c2794dc85af9ed1aa6bd319ba279d04fb34e392/packages/babel-core/src/transformation/file/options/build-config-chain.js#L54

@justinfagnani
Copy link
Contributor

Modules and classic scripts have differences that cause problems when interpreting a script as module. The one I already hit in some testing libraries is that top-level this is undefined in modules.

The compilation feature might make more sense when you view it as leveling the language features available supported browsers, not providing configurable language transforms like Babel in general. We want to be able to send uncompiled source to the latest browsers, so we can't support features that they don't.

@justinfagnani justinfagnani changed the title Polymer 2.0 Build Improvements Polymer 2.0 Build Permutations and Improvements Jan 13, 2017
@aomarks aomarks transferred this issue from Polymer/polymer-cli Jan 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants