Skip to content

Commit

Permalink
Merge branch 'feat/jsx2mp-runtime-alias' into stable/fliggy-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
shiftj18 committed Dec 5, 2022
2 parents 20defa7 + 7279325 commit dc74534
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,17 @@ module.exports = class JSX2MPRuntimePlugin {
compiler.hooks.emit.tapAsync(
'JSX2MPRuntimePlugin',
(compilation, callback) => {
let runtimeName = runtime;
if (!runtimePackageJSONPath) {
runtimePackageJSONPath = getHighestPriorityPackageJSON(runtime, this.rootDir);
const rootDirPackageJSON = readJSONSync(join(this.rootDir, 'package.json'));
if (rootDirPackageJSON.clam && rootDirPackageJSON.clam.raxJsLibAlias && rootDirPackageJSON.clam.raxJsLibAlias[runtime]) {
runtimeName = rootDirPackageJSON.clam.raxJsLibAlias[runtime];
}
runtimePackageJSONPath = getHighestPriorityPackageJSON(runtimeName, this.rootDir);
runtimePackageJSON = readJSONSync(runtimePackageJSONPath);
runtimePackagePath = join(runtimePackageJSONPath, '..');
}
const runtimeTargetPath = `dist/jsx2mp-runtime.${this.platform}.esm.js`;
const runtimeTargetPath = `dist/${runtimeName}.${this.platform}.esm.js`;
const sourceFile = require.resolve(join(runtimePackagePath, runtimeTargetPath));
const targetFile = join(this.outputPath, 'npm', runtime + '.js');

Expand Down

0 comments on commit dc74534

Please sign in to comment.