chore: 由于 vue 升级了部分 api 导致 farm 无法构建,暂通过 vite 进行构建
This commit is contained in:
parent
036470cdb7
commit
a28d572879
@ -34,8 +34,8 @@
|
||||
"vue": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@farmfe/cli": "^1.0.4",
|
||||
"@farmfe/core": "^1.6.7",
|
||||
"@farmfe/cli": "catalog:",
|
||||
"@farmfe/core": "catalog:",
|
||||
"@types/postmate": "catalog:",
|
||||
"@vitejs/plugin-vue": "^5.2.1",
|
||||
"@vtj/cli": "^0.10.4",
|
||||
|
@ -43,6 +43,7 @@ const initPostmateHandshake = async () => {
|
||||
});
|
||||
|
||||
return model.then((parent) => {
|
||||
console.log('parent', parent);
|
||||
// 只获取 accessToken
|
||||
accessToken.value = parent.model.accessToken || '';
|
||||
sessionStorage.setItem('y-code-access-token', accessToken.value);
|
||||
|
@ -4,12 +4,12 @@
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "cross-env farm start --mode development",
|
||||
"dev:staging": "cross-env farm start --mode dev-staging",
|
||||
"dev:prod": "cross-env farm start --mode dev-production",
|
||||
"build": "cross-env farm build --mode production",
|
||||
"build:staging": "cross-env farm build --mode staging",
|
||||
"preview": "cross-env farm preview",
|
||||
"dev": "vite start --mode development",
|
||||
"dev:staging": "vite start --mode dev-staging",
|
||||
"dev:prod": "vite start --mode dev-production",
|
||||
"build": "vite build --mode production",
|
||||
"build:staging": "vite build --mode staging",
|
||||
"preview": "vite preview",
|
||||
"clean": "rimraf node_modules"
|
||||
},
|
||||
"dependencies": {
|
||||
@ -31,8 +31,8 @@
|
||||
"vue-router": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@farmfe/cli": "catalog:",
|
||||
"@farmfe/core": "catalog:",
|
||||
"@farmfe/cli": "^1.0.4",
|
||||
"@farmfe/core": "^1.7.1",
|
||||
"@rushstack/eslint-patch": "^1.10.5",
|
||||
"@tsconfig/node20": "^20.1.4",
|
||||
"@types/node": "^20.17.17",
|
||||
|
69
apps/y-code-v1/vite.config.ts
Normal file
69
apps/y-code-v1/vite.config.ts
Normal file
@ -0,0 +1,69 @@
|
||||
import path from 'node:path';
|
||||
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import vueJsx from '@vitejs/plugin-vue-jsx';
|
||||
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
|
||||
import Components from 'unplugin-vue-components/vite';
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import mkcert from 'vite-plugin-mkcert';
|
||||
import qiankun from 'vite-plugin-qiankun';
|
||||
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), ['VITE_']);
|
||||
const isDev = env.VITE_NODE_ENV === 'development';
|
||||
|
||||
return {
|
||||
plugins: [
|
||||
vue(),
|
||||
vueJsx(),
|
||||
isDev && mkcert(),
|
||||
qiankun('y-code-app', {
|
||||
useDevMode: isDev,
|
||||
}),
|
||||
Components({
|
||||
resolvers: [
|
||||
AntDesignVueResolver({
|
||||
importStyle: 'less',
|
||||
}),
|
||||
],
|
||||
}),
|
||||
],
|
||||
|
||||
server: isDev
|
||||
? {
|
||||
cors: true,
|
||||
port: Number(env.VITE_PORT),
|
||||
https: isDev, // 启用 https,配合 mkcert 插件
|
||||
}
|
||||
: undefined,
|
||||
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
},
|
||||
},
|
||||
|
||||
css: {
|
||||
preprocessorOptions: {
|
||||
less: {
|
||||
javascriptEnabled: true, // 启用 Less 的 JavaScript 功能,通常用于 Ant Design
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
// 启用顶级 await 支持
|
||||
esbuild: {
|
||||
target: 'esnext',
|
||||
supported: {
|
||||
'top-level-await': true,
|
||||
},
|
||||
},
|
||||
|
||||
// 确保构建输出支持顶级 await
|
||||
build: {
|
||||
target: 'esnext',
|
||||
// outDir: path.resolve(process.cwd(), "../../dist/y-code-v1"),
|
||||
// emptyOutDir: true,
|
||||
},
|
||||
};
|
||||
});
|
@ -30,8 +30,8 @@
|
||||
"vue": "catalog:"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@farmfe/cli": "catalog:",
|
||||
"@farmfe/core": "catalog:",
|
||||
"@farmfe/cli": "^1.0.4",
|
||||
"@farmfe/core": "^1.7.1",
|
||||
"@types/postmate": "catalog:",
|
||||
"@vitejs/plugin-vue": "catalog:",
|
||||
"vite-plugin-dts": "catalog:"
|
||||
|
875
pnpm-lock.yaml
generated
875
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user