Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(enhanced): support runtime loading of other external types #3419

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"commit": "cz",
"docs": "typedoc",
"f": "nx format:write",
"enhanced:jest": "pnpm build && cd packages/enhanced && NODE_OPTIONS=--experimental-vm-modules npx jest",
"lint": "nx run-many --target=lint",
"test": "nx run-many --target=test",
"build": "nx run-many --target=build --parallel=5 --projects=tag:type:pkg",
Expand Down Expand Up @@ -228,6 +229,7 @@
"vue-tsc": "^2.0.26",
"wait-on": "^7.2.0",
"webpack": "5.93.0",
"webpack-cli": "^6.0.1",
"webpack-virtual-modules": "0.6.2",
"whatwg-fetch": "^3.6.20",
"yargs": "^17.7.2"
Expand Down
7 changes: 6 additions & 1 deletion packages/enhanced/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ export default {
moduleFileExtensions: ['ts', 'js', 'html'],
coverageDirectory: '../../coverage/packages/enhanced',
rootDir: __dirname,
testMatch: ['<rootDir>/test/*.basictest.js'],
testMatch: [
'<rootDir>/test/*.basictest.js',
'<rootDir>/src/**/*.spec.ts',
'<rootDir>/test/**/*.spec.ts',
'<rootDir>/src/**/*.test.ts',
],

testEnvironment: path.resolve(__dirname, './test/patch-node-env.js'),
setupFilesAfterEnv: ['<rootDir>/test/setupTestFramework.js'],
Expand Down
5 changes: 4 additions & 1 deletion packages/enhanced/src/lib/container/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
import path from 'path';
import { TEMP_DIR as BasicTempDir } from '@module-federation/sdk';

const FEDERATION_SUPPORTED_TYPES = ['script'];
const FEDERATION_SUPPORTED_TYPES = [
'script',
'commonjs'
];
const TEMP_DIR = path.join(`${process.cwd()}/node_modules`, BasicTempDir);

export { FEDERATION_SUPPORTED_TYPES, TEMP_DIR };
Loading
Loading