babel-vite
babel-vite copied to clipboard
Fix "eager: true emits require (doesn't exist in browsers) instead of import"
What:
Fixes https://github.com/OpenSourceRaidGuild/babel-vite/issues/57
Why:
We expect import to be used instead of require:
const __glob__0_0 = require("./scenarios/baseline-handlebars-list.gjs");
const __glob__0_1 = require("./scenarios/baseline-inner-html.gjs");
const __glob__0_2 = require("./scenarios/ember-get.gjs");
const definedScenarios = {
"./scenarios/baseline-handlebars-list.gjs": __glob__0_0,
"./scenarios/baseline-inner-html.gjs": __glob__0_1,
"./scenarios/ember-get.gjs": __glob__0_2
};
should be
import __glob__0_0 from "./scenarios/baseline-handlebars-list.gjs";
import __glob__0_1 from "./scenarios/baseline-inner-html.gjs";
import __glob__0_2 from "./scenarios/ember-get.gjs";
const definedScenarios = {
"./scenarios/baseline-handlebars-list.gjs": __glob__0_0,
"./scenarios/baseline-inner-html.gjs": __glob__0_1,
"./scenarios/ember-get.gjs": __glob__0_2
};
This is already listed in the documentation.
How:
Adapted the transformer and tests.
Checklist:
- [X] Documentation updated
- [X] Tests
- [X] Ready to be merged
- [ ] Added myself to contributors table
@mpeyper Not sure who the right person to tag for this is, is there any feedback from you on this?
@mpeyper Happy new year 🥳 Bumping this PR so it doesn't get lost 🙈 Any update on the checks or anything I can help with?