@lark-apaas/fullstack-rspack-preset 1.0.57 → 1.0.58-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -83,10 +83,12 @@ class BasenameInjectionPlugin {
83
83
  apply(compiler) {
84
84
  const loaderPath = path_1.default.resolve(__dirname, './basename-injection-loader.js');
85
85
  const envBasePath = this.envBasePath;
86
- // entryOption hook:配置已完全解析合并(包括异步 entry 函数的返回值),
87
- // 是读 entry 最安全的时机。参考 RuntimeInjectionPlugin 的做法。
88
- compiler.hooks.entryOption.tap(PLUGIN_NAME, (context, entry) => {
89
- // 动态 entry(函数形式)无法在此阶段解析,兜底到默认正则
86
+ // afterEnvironment hook:所有配置(包括 extends、merge)已完成,
87
+ // compiler.options.entry compiler.options.module 都是最终值。
88
+ compiler.hooks.afterEnvironment.tap(PLUGIN_NAME, () => {
89
+ const context = compiler.options.context || process.cwd();
90
+ const entry = compiler.options.entry;
91
+ // 从已解析的 entry 提取业务入口文件路径
90
92
  const entryFiles = (typeof entry !== 'function')
91
93
  ? resolveEntryFiles(entry, context)
92
94
  : [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/fullstack-rspack-preset",
3
- "version": "1.0.57",
3
+ "version": "1.0.58-alpha.0",
4
4
  "files": [
5
5
  "lib",
6
6
  "patches",