Conversation
Because we were building it from the main gulp file, it was including the packages that the monorepo depends on (version alpha.18 currently). But, alpha.18 doesn’t have `PrivateName` (cause it’s going into alpha.19). So when I tried to build alpha.19, it failed. Now, we have babel-standalone’s own gulp do the build. And it correctly depends on the alpha.19 packages (and they include `PrivateName` now), so it builds.
|
@jridgewell, thanks for your PR! By analyzing the history of the files in this pull request, we identified @hzoo, @ChauTNguyen and @danez to be potential reviewers. |
Daniel15
left a comment
There was a problem hiding this comment.
This looks fine to me, but I don't quite understand why it fixes things. Why would the monorepo reference be different to the babel-standalone reference?
| BABEL_VERSION: | ||
| JSON.stringify(require("babel-core/package.json").version), | ||
| BABEL_VERSION: JSON.stringify( | ||
| require("babel-core/package.json").version, |
There was a problem hiding this comment.
This is still defining the BABEL_VERSION by loading the babel-core from node_modules instead of the babel-core being compiled 🤔
There was a problem hiding this comment.
Why wouldn't it be the babel-core version being compiled? If we're in babel-standalone, wouldn't require('babel-core') give us the babel-core that's been symlinked via Lerna?
|
Damn it, this still doesn't fix it. The issue is that this is loading |
|
/cc @hzoo: I think the yarn workspaces are screwing up. |
|
You can checkout #6120 to see what's going on. I've defined the new |
I think this is the root cause for babel/babel#6132.
| node scripts/generate-babel-types-docs.js | ||
|
|
||
| build-babel-standalone: | ||
| cd packages/babel-standalone; \ |
There was a problem hiding this comment.
I think this will mess up the cwd, since you don't cd ../.. at the end. It should likely use pushd and popd instead. Having said that, Gulp has a --cwd option that might be able to be used instead: https://github.com/gulpjs/gulp/blob/master/docs/recipes/specifying-a-cwd.md
eg.
./node_modules/.bin/gulp build --cwd=packages/babel-standalone
| } | ||
|
|
||
| module.exports = registerGulpTasks; | ||
| gulp.task("build", cb => { |
There was a problem hiding this comment.
I'd prefer to still export this as a reusable function, as babili-standalone / babel-minify-standalone will reuse it. Maybe keep it in a separate file, and have a Gulpfile.js in this directory that imports it?
Because we were building it from the main gulp file, it was including
the packages that the monorepo depends on (version alpha.18 currently).
But, alpha.18 doesn’t have
PrivateName(cause it’s going intoalpha.19). So when I tried to build alpha.19, it failed.
Now, we have babel-standalone’s own gulp do the build. And it correctly
depends on the alpha.19 packages (and they include
PrivateNamenow),so it builds.