foundation-sites: Babel doesn't work on default foundation-zurb-template
[19:04:27] Failed to load external module babel-register
[19:04:27] Requiring external module babel-core/register
This is on Debian sid’s builds of node and npm, version 4.3.1 and 1.4.21 respectively.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 42 (10 by maintainers)
Commits related to this issue
- meh https://github.com/zurb/foundation-sites/issues/8256 — committed to ucla/foundation-zurb-template by erutan 8 years ago
To address a few things that I don’t believe have been mentioned:
gulp-babelwill read the configuration you have in.babelrcif it exists, even if you pass even a configuration object when calling$.babel()in your Gulpfile..babelrc. Therefore, both your JavaScript build process and your Gulpfile have to be transpiled with the same Babel configuration.es2015preset includes a CommonJS plugin, and one of the things it does is rename any top-level use ofthistoundefined.this, which Babel was then breaking. The error in the console reads something likeCannot read property "root" of undefined.thistoundefinedby setting theallowTopLevelThisoption totrue.importstatements.So this is a tangled web. Thankfully, we’re getting close to an out:
es2015plugin with all the defaults set..babelrcandpackage.jsonare much simpler: two Babel dependencies, one Babel preset.We’ve already merged a PR to bump our what-input dependency to 2.0, so we can deploy that with a version 6.2.1.
Sorry for the hassle, friends, and thanks for your patience 😃