Don't include "resolve" in @babel/standalone#11432
Don't include "resolve" in @babel/standalone#11432nicolo-ribaudo merged 2 commits intobabel:masterfrom
Conversation
|
Is there any way to add a test for this? |
|
I tried to search for a rollup option to disallow some modules, but I couldn't find it. |
|
It is still including |
| "keywords": [ | ||
| "babel-plugin" | ||
| ], | ||
| "browser": { |
There was a problem hiding this comment.
Seems like it suffices to set preferBuiltins: false when building babel-standalone, so it can warn us on builtin imports which is not yet covered by rollup-plugin-node-polyfill.
There was a problem hiding this comment.
Oh but it will not cover cases like resolve is imported. Maybe we can do something like
{
name: "warn-browser-unsupported-modules",
resolveId(...args) {
const [source] = args;
if (["resolve"].includes(source)) {
throw new Error(`${source} can not be bundled into @babel/standalone!`);
}
return this.resolve(...args);
}
}Anyway I am happy if we merge it as-is and postpone to another PR.
There was a problem hiding this comment.
Yeah, I'm merging this for now and I will investigate. I'm surprised that I can't find a plugin that does what we need 🤔
There was a problem hiding this comment.
@nicolo-ribaudo You may checkout https://github.com/dumbmatter/rollup-plugin-blacklist but I am not strongly for that.
There was a problem hiding this comment.
May I ask why don't you like it?
Starting from browserify/resolve#217,
resolveunconditionally uses thefsobject (even if we don't call anyresolvefunction).This is a problem in
@babel/standalonesincefsisn't available there. However,resolveshouldn't have been included in@babel/standalonein the first place 🤷