Skip to content

Commit

Permalink
refactor(miniapp): optimize entry name in runtime miniapp (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisCindy authored Dec 24, 2020
1 parent da754ff commit 3f99ebb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/plugin-rax-miniapp/src/setEntry.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const fs = require('fs-extra');
const path = require('path');
const { getAppConfig } = require('miniapp-builder-shared');
const { getAppConfig, pathHelper: { getBundlePath } } = require('miniapp-builder-shared');

module.exports = (config, context, target) => {
const { rootDir, userConfig } = context;
Expand All @@ -12,13 +12,13 @@ module.exports = (config, context, target) => {
appConfig.routes.forEach((app) => {
const subAppRoot = path.dirname(app.source);
const subAppEntry = moduleResolve(formatPath(path.join(rootDir, 'src', subAppRoot, 'app')));
const subAppEntryConfig = config.entry(subAppRoot);
const subAppEntryConfig = config.entry(getBundlePath(subAppRoot));
subAppEntryConfig.add(subAppEntry);
});
} else {
// SPA
const appEntry = moduleResolve(formatPath(path.join(rootDir, './src/app')));
const entryConfig = config.entry('index');
const entryConfig = config.entry(getBundlePath());

entryConfig.add(appEntry);
}
Expand Down

0 comments on commit 3f99ebb

Please sign in to comment.