@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
|
-
//
|
|
87
|
-
//
|
|
88
|
-
compiler.hooks.
|
|
89
|
-
|
|
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
|
: [];
|