File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/miniapp-compile-config/src/plugins Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -37,12 +37,17 @@ module.exports = class JSX2MPRuntimePlugin {
3737 compiler . hooks . emit . tapAsync (
3838 'JSX2MPRuntimePlugin' ,
3939 ( compilation , callback ) => {
40+ let runtimeName = runtime ;
4041 if ( ! runtimePackageJSONPath ) {
41- runtimePackageJSONPath = getHighestPriorityPackageJSON ( runtime , this . rootDir ) ;
42+ const rootDirPackageJSON = readJSONSync ( join ( this . rootDir , 'package.json' ) ) ;
43+ if ( rootDirPackageJSON . clam && rootDirPackageJSON . clam . raxJsLibAlias && rootDirPackageJSON . clam . raxJsLibAlias [ runtime ] ) {
44+ runtimeName = rootDirPackageJSON . clam . raxJsLibAlias [ runtime ] ;
45+ }
46+ runtimePackageJSONPath = getHighestPriorityPackageJSON ( runtimeName , this . rootDir ) ;
4247 runtimePackageJSON = readJSONSync ( runtimePackageJSONPath ) ;
4348 runtimePackagePath = join ( runtimePackageJSONPath , '..' ) ;
4449 }
45- const runtimeTargetPath = `dist/jsx2mp-runtime .${ this . platform } .esm.js` ;
50+ const runtimeTargetPath = `dist/${ runtimeName } .${ this . platform } .esm.js` ;
4651 const sourceFile = require . resolve ( join ( runtimePackagePath , runtimeTargetPath ) ) ;
4752 const targetFile = join ( this . outputPath , 'npm' , runtime + '.js' ) ;
4853
You can’t perform that action at this time.
0 commit comments