Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions packages/runtime/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,7 @@ module.exports = (rollupConfig, projectOptions) => {

const project = projectOptions.project;
const pkg = require(project);
const RELEASE_NUMBER = Number(
`${semver.major(pkg.version)}${semver.minor(pkg.version)}${semver.patch(
pkg.version,
)}`,
);

if (Number.isNaN(RELEASE_NUMBER)) {
throw new Error(
`RELEASE_NUMBER is not valid number , please check current pkg.version is valid.`,
);
}
if (rollupConfig.output.format === 'esm' && FEDERATION_DEBUG) {
rollupConfig.output.format = 'iife';
rollupConfig.output.inlineDynamicImports = true;
Expand All @@ -33,19 +23,10 @@ module.exports = (rollupConfig, projectOptions) => {
}

rollupConfig.plugins.push(
// alias({
// entries: [
// {
// find: '@module-federation/sdk',
// replacement: path.resolve(__dirname, '../../dist/packages/sdk'),
// },
// ],
// }),
replace({
preventAssignment: true,
__VERSION__: `'${pkg.version}'`,
FEDERATION_DEBUG: `'${FEDERATION_DEBUG}'`,
__RELEASE_NUMBER__: RELEASE_NUMBER,
__VERSION__: JSON.stringify(pkg.version),
FEDERATION_DEBUG: JSON.stringify(FEDERATION_DEBUG),
}),
copy({
targets: [
Expand Down
3 changes: 1 addition & 2 deletions packages/runtime/src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ export class FederationHost {
origin: FederationHost;
}>(),
});
releaseNumber = `__RELEASE_NUMBER__`;
version: string = `__VERSION__`;
version: string = __VERSION__;
name: string;
moduleCache: Map<string, Module> = new Map();
snapshotHandler: SnapshotHandler;
Expand Down