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

.babelrc not being copied over #507

Closed
Icehunter opened this issue Jun 15, 2016 · 17 comments
Closed

.babelrc not being copied over #507

Icehunter opened this issue Jun 15, 2016 · 17 comments

Comments

@Icehunter
Copy link

Hi!

Great package here; it seems in the update from 3 -> 5 the build process no longer copies over my .babelrc file which is in the main app folder.

Is there a way to include this? I might have missed it in the docs but didn't see it while reading them over.

Thanks!

@Icehunter
Copy link
Author

Sorry, figured it out.

files: ["**\/*", "**\/.*"]

@develar
Copy link
Member

develar commented Jun 16, 2016

Reopened— such file must be included. Why do you include it in the final app? Production app should not require babel

@Icehunter
Copy link
Author

Icehunter commented Jun 16, 2016

I use it for import/export support:

{
  "plugins": ["transform-es2015-modules-commonjs"]
}

I guess I could take it out; but that's all I'm using babel for. One day electron is going to have full ES6 support and I can remove it and not have to change any of my code :)

@Icehunter
Copy link
Author

In addition I think I can just add this to package.json and it will be fine. According to the docs here:

https://babeljs.io/docs/usage/babelrc/

@develar
Copy link
Member

develar commented Jun 16, 2016

Yes, I suggest to not use babel in production and move config into the package.json.

Currently, your pattern is very permissive — please see #496 (comment)

@TimNZ
Copy link

TimNZ commented Jul 4, 2017

@develar Man why are you hard-coding ignoring certain attributes in extraMetadata?

I'm trying to include a babel section instead of having a .babelrc

Please do not be so opinionated in making decisions for us.

I have dynamic loading of plugins using babel to support JSX.

fileTransformer:

const ignoredPackageMetadataProperties = new Set(["dist", "gitHead", "keywords", "build", "devDependencies", "scripts", "jspm", "ava", "babel", "xo", "nyc", "eslintConfig"]);

@develar
Copy link
Member

develar commented Jul 4, 2017

I have dynamic loading of plugins using babel to support JSX

Why not compile it for production?

@develar
Copy link
Member

develar commented Jul 4, 2017

@TimNZ Please provide your dependencies We will check that no babel plugins in it and only in this case remove babel config.

@TimNZ
Copy link

TimNZ commented Jul 4, 2017

Why are you making it so complex @develar and more work for yourself?
Why can't you just leave babel in there - what do you care?

@develar
Copy link
Member

develar commented Jul 4, 2017

@TimNZ Some users worry about security and don't want to see dev stuff.

@develar
Copy link
Member

develar commented Jul 4, 2017

@TimNZ Fixed in the upcoming 19.13.0. dependencies list is still welcome.

@TimNZ
Copy link

TimNZ commented Jul 4, 2017

Thanks.
I've ended up using a .babelrc file for the time being.

I don't understand your comment about security - who are these users that care there is a babel section in package.json - who cares what's in there? How did you decide there is a security concern, and what is it? Who's looking at package.json, typically inside app.asar?

If you must insist on a dependencies check, anything starting with 'babel', though even that is arbitrary.

@develar
Copy link
Member

develar commented Jul 4, 2017

@TimNZ #1764 #1212

@TimNZ
Copy link

TimNZ commented Jul 4, 2017

@develar You based on your comments on one person saying babel should be stripped?

That is not a rigorous justification for doing anything unless that person happens to be your boss and they will fire you for not following instructions :)

@develar
Copy link
Member

develar commented Jul 4, 2017

You should preprocess for production build and babel should be in the dev deps.

@TimNZ
Copy link

TimNZ commented Jul 4, 2017

Focus on improving the QA of this excellent very appreciated tool and stop telling people what they should do.

@develar
Copy link
Member

develar commented Jul 5, 2017

@TimNZ that's why your comment is taken into account and it is fixed in the 19.13.0 No — I will continue telling what people should do — it is called convention over configuration. If I am wrong — thanks for feedback. In this case we still recommend to not use babel in the production but if you want to do — it is ok and does not lead to issue.

QA — we do unit and integration tests, but final QA is performed by users. We use tagged as next releases, but often users don't use it and feedback reported after release tagged as latest.

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

No branches or pull requests

3 participants