-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
254 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.