mirror of https://github.com/alibaba/ice.git
chore: add plugin rax compat
This commit is contained in:
parent
5c8706e1e9
commit
37496476f4
|
|
@ -1,6 +1,7 @@
|
|||
import { defineConfig } from '@ice/app';
|
||||
import SpeedMeasurePlugin from 'speed-measure-webpack-plugin';
|
||||
import pluginAuth from '@ice/plugin-auth';
|
||||
import pluginRaxCompat from '@ice/plugin-rax-compat';
|
||||
|
||||
export default defineConfig({
|
||||
publicPath: '/',
|
||||
|
|
@ -15,6 +16,6 @@ export default defineConfig({
|
|||
return webpackConfig;
|
||||
},
|
||||
dropLogLevel: 'warn',
|
||||
plugins: [pluginAuth()],
|
||||
plugins: [pluginAuth(), pluginRaxCompat()],
|
||||
eslint: true,
|
||||
});
|
||||
|
|
@ -11,6 +11,7 @@
|
|||
"dependencies": {
|
||||
"@ice/app": "workspace:*",
|
||||
"@ice/plugin-auth": "workspace:*",
|
||||
"@ice/plugin-rax-compat": "workspace:*",
|
||||
"@ice/runtime": "workspace:*",
|
||||
"ahooks": "^3.3.8",
|
||||
"react": "^18.0.0",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
# @ice/plugin-rax-compat
|
||||
|
||||
ice plugin for migrate `rax-app` project to `ice`.
|
||||
|
||||
## Usage
|
||||
|
||||
add plugin in `ice.config.ts`:
|
||||
|
||||
```js
|
||||
import raxCompat from '@ice/plugin-rax-compat';
|
||||
|
||||
export default {
|
||||
plugins: [raxCompat()],
|
||||
}
|
||||
```
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"name": "@ice/plugin-rax-compat",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./esm/index.js",
|
||||
"default": "./esm/index.js"
|
||||
}
|
||||
},
|
||||
"main": "./esm/index.js",
|
||||
"types": "./esm/index.d.ts",
|
||||
"files": [
|
||||
"esm",
|
||||
"!esm/**/*.map"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@ice/types": "^1.0.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "http",
|
||||
"url": "https://github.com/ice-lab/ice-next/tree/master/packages/plugin-rax-compat"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
import type { Plugin } from '@ice/types';
|
||||
|
||||
const plugin: Plugin = ({ onGetConfig }) => {
|
||||
onGetConfig((config) => {
|
||||
config.configureWebpack = [...(config.configureWebpack || []), (webpackConfig) => {
|
||||
webpackConfig.resolve.alias = {
|
||||
...(webpackConfig.resolve.alias || {}),
|
||||
rax: 'rax-compat',
|
||||
};
|
||||
return webpackConfig;
|
||||
}];
|
||||
});
|
||||
};
|
||||
|
||||
export default () => ({
|
||||
name: '@ice/plugin-rax-compat',
|
||||
plugin,
|
||||
});
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"rootDir": "src",
|
||||
"outDir": "esm",
|
||||
"jsx": "react"
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
|
|
@ -76,6 +76,7 @@ importers:
|
|||
specifiers:
|
||||
'@ice/app': workspace:*
|
||||
'@ice/plugin-auth': workspace:*
|
||||
'@ice/plugin-rax-compat': workspace:*
|
||||
'@ice/runtime': workspace:*
|
||||
'@types/react': ^18.0.0
|
||||
'@types/react-dom': ^18.0.2
|
||||
|
|
@ -89,6 +90,7 @@ importers:
|
|||
dependencies:
|
||||
'@ice/app': link:../../packages/ice
|
||||
'@ice/plugin-auth': link:../../packages/plugin-auth
|
||||
'@ice/plugin-rax-compat': link:../../packages/plugin-rax-compat
|
||||
'@ice/runtime': link:../../packages/runtime
|
||||
ahooks: 3.3.10_react@18.0.0
|
||||
react: 18.0.0
|
||||
|
|
@ -359,6 +361,12 @@ importers:
|
|||
'@types/react': 18.0.8
|
||||
'@types/react-dom': 18.0.3
|
||||
|
||||
packages/plugin-rax-compat:
|
||||
specifiers:
|
||||
'@ice/types': ^1.0.0
|
||||
devDependencies:
|
||||
'@ice/types': link:../types
|
||||
|
||||
packages/route-manifest:
|
||||
specifiers:
|
||||
minimatch: ^5.0.1
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
{ "path": "packages/types" },
|
||||
{ "path": "packages/webpack-config" },
|
||||
{ "path": "packages/ice" },
|
||||
{ "path": "packages/plugin-auth" }
|
||||
{ "path": "packages/plugin-auth" },
|
||||
{ "path": "packages/plugin-rax-compat" }
|
||||
]
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue