Skip to content

Commit

Permalink
fix: browser compatibility for umd mode
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxingkang committed Sep 5, 2022
1 parent 3172291 commit e294f3b
Show file tree
Hide file tree
Showing 11 changed files with 1,722 additions and 1,754 deletions.
2 changes: 1 addition & 1 deletion boilerplate/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"dev": "pnpm tsc --watch"
},
"dependencies": {
"@umijs/utils": "^4.0.0"
"@umijs/utils": "^4.0.17"
},
"publishConfig": {
"access": "public"
Expand Down
9 changes: 8 additions & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { createConfig } from '@umijs/test';

const defaultConfig = createConfig();

export default {
...createConfig(),
...defaultConfig,
moduleNameMapper: {
...defaultConfig.moduleNameMapper,
// @umijs/bundler-webpack requireHook not working for jest
'^webpack$': '@umijs/bundler-webpack/compiled/webpack',
},
collectCoverageFrom: ['<rootDir>/src/**/*.ts', '!<rootDir>/src/cli/*.ts'],
modulePathIgnorePatterns: [
'<rootDir>/tests/fixtures/.+/compiled',
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
},
"dependencies": {
"@microsoft/api-extractor": "7.29.5",
"@umijs/babel-preset-umi": "^4.0.0",
"@umijs/bundler-utils": "^4.0.0",
"@umijs/bundler-webpack": "^4.0.0",
"@umijs/core": "^4.0.0",
"@umijs/utils": "^4.0.0",
"@umijs/babel-preset-umi": "^4.0.17",
"@umijs/bundler-utils": "^4.0.17",
"@umijs/bundler-webpack": "^4.0.17",
"@umijs/core": "^4.0.17",
"@umijs/utils": "^4.0.17",
"@vercel/ncc": "0.33.3",
"babel-plugin-module-resolver": "4.1.0",
"babel-plugin-react-require": "3.1.3",
Expand All @@ -80,7 +80,7 @@
"@types/loader-runner": "2.2.4",
"@types/minimatch": "3.0.5",
"@types/node": "^18.0.0",
"@umijs/test": "^4.0.0",
"@umijs/test": "^4.0.17",
"@zerollup/ts-transform-paths": "1.7.18",
"git-repo-info": "^2.1.1",
"husky": "^8.0.1",
Expand Down
Loading

0 comments on commit e294f3b

Please sign in to comment.