[next] Bootstrap plugins directly (#1698)

This commit is contained in:
Andrea Giammarchi
2023-09-14 11:11:44 +02:00
committed by GitHub
parent 7994207c78
commit 3aef5a99dc
8 changed files with 70 additions and 47 deletions

View File

@@ -10,7 +10,11 @@ for (const file of readdirSync(join(__dirname, "..", "src", "plugins"))) {
? name
: `[${JSON.stringify(name)}]`;
const value = JSON.stringify(`./plugins/${file}`);
plugins.push(` ${key}: () => import(${value}),`);
plugins.push(
// this comment is needed to avoid bundlers eagerly embedding lazy
// dependencies, causing all sort of issues once in production
` ${key}: () => import(/* webpackIgnore: true */ ${value}),`,
);
}
}