[TIMOB-25837] CLI: Babel config in root of project is detected
GitHub Issue | n/a |
Type | Bug |
Priority | None |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 7.1.0, Release 7.0.2, Release 7.2.0 |
Fix Version/s | n/a |
Components | CLI |
Labels | cb-tooling |
Reporter | Ewan Harris |
Assignee | Unknown |
Created | 2018-03-05T11:06:06.000+0000 |
Updated | 2020-01-30T21:29:51.000+0000 |
Description
Description
If a babel config (via .babelrc or package.json) is defined in the Titanium project root then babel will pick this up and merge it with the one populated in the SDK. Personally I think that this is valuable, but has the opportunity to cause problems as seen in ALOY-1605. We can disable this by setting the babelrc
option in babel-core to false like we do in Alloy
This occurs since 7.0.2.GA, but only occurs when building to device (minification enabled) in that SDK
Steps to reproduce
1. Add a file named .babelrc
in the root your Titanium project
2. Add { "plugins": \[ "transform-react-jsx" \] \} to the .babelrc
3. Build a Titanium app
Actual
Build will fail with \[ERROR\] Unknown plugin "transform-react-jsx" specified in "/Users/eharris/Documents/Appcelerator_Studio_Workspace/ticreateapp/.babelrc" at 0, attempted to resolve relative to "/Users/eharris/Documents/Appcelerator_Studio_Workspace/ticreateapp"
as babel-core will pick up the babel config
Expected
Not sure, do we allow babel configs to be overidden? If not then the error shouldn't occurs, if so then this ticket is invalid
Comments
JSON Source
cc [~cwilliams] [~emerriman] [~hknoechel] [~gmathews] What do you think, supporting this would totally make this even better, but I think allowing babel to merge the configs might cause the plugin ordering to be off meaning that the global-this custom plugin might not be run last and therefore breaking code like ALOY-1605. I think if we merge manually in node-titanium-sdk we can ensure global-this is placed last which I believe is where it needs to be