Skip to content

Commit

Permalink
fix(runtime-core): update build output configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
ScriptedAlchemy committed Dec 3, 2024
1 parent 091299e commit f7479be
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/runtime-core/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ declare const __VERSION__: string;
declare const FEDERATION_DEBUG: string;
declare const FEDERATION_BUILD_IDENTIFIER: string | undefined;
declare const __RELEASE_NUMBER__: number;
declare const FEDERATION_ALLOW_NEW_FUNCTION: string | undefined;
6 changes: 3 additions & 3 deletions packages/runtime-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.6.14",
"author": "zhouxiao <codingzx@gmail.com>",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"module": "./dist/index.esm.mjs",
"types": "./dist/index.cjs.d.ts",
"license": "MIT",
"publishConfig": {
Expand All @@ -16,12 +16,12 @@
"exports": {
".": {
"types": "./dist/index.cjs.d.ts",
"import": "./dist/index.esm.js",
"import": "./dist/index.esm.mjs",
"require": "./dist/index.cjs.js"
},
"./types": {
"types": "./dist/types.cjs.d.ts",
"import": "./dist/types.esm.js",
"import": "./dist/types.esm.mjs",
"require": "./dist/types.cjs.js"
}
},
Expand Down
3 changes: 2 additions & 1 deletion packages/runtime-core/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
"project": "packages/runtime-core/package.json",
"compiler": "swc",
"rollupConfig": "packages/runtime-core/rollup.config.js",
"format": ["cjs", "esm"]
"format": ["cjs", "esm"],
"generatePackageJson": false
},
"dependsOn": [
{
Expand Down
18 changes: 18 additions & 0 deletions packages/runtime-core/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ module.exports = (rollupConfig, projectOptions) => {
return 'polyfills';
}
},
hoistTransitiveImports: false,
entryFileNames:
c.format === 'esm'
? c.entryFileNames.replace('.js', '.mjs')
: c.entryFileNames,
chunkFileNames:
c.format === 'esm'
? c.chunkFileNames.replace('.js', '.mjs')
: c.chunkFileNames,
}));
} else {
rollupConfig.output = {
Expand All @@ -36,6 +45,15 @@ module.exports = (rollupConfig, projectOptions) => {
return 'polyfills';
}
},
hoistTransitiveImports: false,
entryFileNames:
rollupConfig.output.format === 'esm'
? rollupConfig.output.entryFileNames.replace('.js', '.mjs')
: rollupConfig.output.entryFileNames,
chunkFileNames:
rollupConfig.output.format === 'esm'
? rollupConfig.output.chunkFileNames.replace('.js', '.mjs')
: rollupConfig.output.chunkFileNames,
};
}

Expand Down

0 comments on commit f7479be

Please sign in to comment.