Skip to content

Commit

Permalink
chore: update umi
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohuoni committed Apr 14, 2022
1 parent 7a2ca94 commit 2b27f6d
Show file tree
Hide file tree
Showing 9 changed files with 254 additions and 199 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"updateInternalDependents": "always"
},
"ignore": ["@examples/*"]
"ignore": ["@examples/boilerplate"]
}
8 changes: 8 additions & 0 deletions .changeset/giant-mayflies-work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'alita': patch
'create-alita': patch
'@alita/native': patch
'@alita/plugins': patch
---

chore: update umi
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"devDependencies": {
"@types/qrcode-terminal": "*",
"@types/rimraf": "3.0.2",
"umi": "4.0.0-canary.20220412.3",
"@umijs/utils": "4.0.0-canary.20220412.3",
"@umijs/plugin-docs": "4.0.0-canary.20220412.3",
"umi": "4.0.0-canary.20220414.1",
"@umijs/utils": "4.0.0-canary.20220414.1",
"@umijs/plugin-docs": "4.0.0-canary.20220414.1",
"@changesets/cli": "2.19.0",
"@changesets/changelog-github": "0.4.2",
"alita": "workspace:*",
Expand Down
10 changes: 5 additions & 5 deletions packages/alita/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@
"dependencies": {
"@alita/native": "workspace:*",
"@alita/plugins": "workspace:*",
"@umijs/bundler-utils": "4.0.0-canary.20220412.3",
"@umijs/core": "4.0.0-canary.20220412.3",
"@umijs/renderer-react": "4.0.0-canary.20220412.3",
"@umijs/utils": "4.0.0-canary.20220412.3",
"@umijs/bundler-utils": "4.0.0-canary.20220414.1",
"@umijs/core": "4.0.0-canary.20220414.1",
"@umijs/renderer-react": "4.0.0-canary.20220414.1",
"@umijs/utils": "4.0.0-canary.20220414.1",
"qrcode-terminal": "^0.12.0",
"umi": "4.0.0-canary.20220412.3",
"umi": "4.0.0-canary.20220414.1",
"v8-compile-cache": "^2.3.0"
}
}
49 changes: 49 additions & 0 deletions packages/alita/src/features/nodeModulesTransform.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { AlitaApi } from 'alita';

export default (api: AlitaApi) => {
// nodeModulesTransform
api.describe({
key: 'nodeModulesTransform',
config: {
schema(Joi) {
return Joi.object();
},
},
enableBy: api.EnableBy.config,
});
api.chainWebpack((memo) => {
const isProd = api.env === 'production';
if (!isProd) return memo;
memo.module
.rule('js-in-node_modules')
.test(/\.(js|mjs)$/)
.include.add(/node_modules/)
.end()
.use('babel-loader')
.loader(require.resolve('@umijs/bundler-webpack/compiled/babel-loader'))
.options({
// Tell babel to guess the type, instead assuming all files are modules
// https://github.com/webpack/webpack/issues/4039#issuecomment-419284940
sourceType: 'unambiguous',
babelrc: false,
cacheDirectory: false,
targets: {
ie: 8,
},
presets: [
[
require.resolve('@umijs/babel-preset-umi'),
{
presetEnv: {},
presetReact: {},
presetTypeScript: {},
pluginTransformRuntime: {},
pluginLockCoreJS: {},
pluginDynamicImportNode: false,
},
],
],
});
return memo;
});
};
2 changes: 1 addition & 1 deletion packages/create-alita/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
"create-alita": "bin/create-alita.js"
},
"dependencies": {
"@umijs/utils": "4.0.0-canary.20220412.3"
"@umijs/utils": "4.0.0-canary.20220414.1"
}
}
2 changes: 1 addition & 1 deletion packages/native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
},
"dependencies": {
"alita": "workspace:*",
"@umijs/utils": "4.0.0-canary.20220412.3"
"@umijs/utils": "4.0.0-canary.20220414.1"
},
"license": "MIT"
}
6 changes: 3 additions & 3 deletions packages/plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"@alita/alita-layout": "^3.0.5",
"@alita/inspx": "0.0.2",
"@alita/request": "workspace:*",
"@umijs/bundler-utils": "4.0.0-canary.20220412.3",
"@umijs/plugins": "4.0.0-canary.20220412.3",
"@umijs/utils": "4.0.0-canary.20220412.3",
"@umijs/bundler-utils": "4.0.0-canary.20220414.1",
"@umijs/plugins": "4.0.0-canary.20220414.1",
"@umijs/utils": "4.0.0-canary.20220414.1",
"ahooks": "^3.0.8",
"alita": "workspace:*",
"antd-mobile-icons": "^0.2.2",
Expand Down
Loading

0 comments on commit 2b27f6d

Please sign in to comment.