mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 10:38:16 +08:00
chore: 调整 vite 后 gh-pages 问题修复 (#5682)
* chore: 调整 vite 后 gh-pages 问题修复 * 降级monaco-editor
This commit is contained in:
parent
c591ab4381
commit
cd7d6062aa
File diff suppressed because one or more lines are too long
@ -137,7 +137,7 @@ fis.match('monaco-editor/min/**.js', {
|
||||
ignoreDependencies: true
|
||||
});
|
||||
|
||||
fis.match('/docs/**.md', {
|
||||
fis.match('{/docs,/packages/amis-ui/scss/helper}/**.md', {
|
||||
rExt: 'js',
|
||||
ignoreDependencies: true,
|
||||
parser: [
|
||||
@ -223,7 +223,7 @@ fis.match('*.html:jsx', {
|
||||
|
||||
// 这些用了 esm
|
||||
fis.match(
|
||||
'{echarts/extension/**.js,zrender/**.js,markdown-it-html5-media/**.js,react-hook-form/**.js,qrcode.react/**.js}',
|
||||
'{echarts/extension/**.js,zrender/**.js,markdown-it-html5-media/**.js,react-hook-form/**.js,qrcode.react/**.js,axios/**.js}',
|
||||
{
|
||||
parser: fis.plugin('typescript', {
|
||||
sourceMap: false,
|
||||
@ -640,7 +640,7 @@ if (fis.project.currentMedia() === 'publish-sdk') {
|
||||
rExt: '.css'
|
||||
});
|
||||
|
||||
ghPages.match('/docs/**.md', {
|
||||
ghPages.match('{/docs,/packages/amis-ui/scss/helper}/**.md', {
|
||||
rExt: 'js',
|
||||
isMod: true,
|
||||
useHash: true,
|
||||
|
@ -50,12 +50,13 @@
|
||||
}
|
||||
link.setAttribute(
|
||||
'href',
|
||||
new URL(`./packages/amis/lib/themes/${key}.css`, import.meta.url).href
|
||||
new URL(`./packages/amis-ui/scss/themes/${key}.scss`, import.meta.url)
|
||||
.href
|
||||
);
|
||||
document.head.appendChild(link);
|
||||
});
|
||||
</script>
|
||||
<link rel="stylesheet" href="./packages/amis/lib/helper.css" />
|
||||
<link rel="stylesheet" href="./packages/amis-ui/scss/helper.scss" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -28,6 +28,7 @@
|
||||
"qs": "6.9.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-replace": "^5.0.1",
|
||||
"@types/express": "^4.17.14",
|
||||
"@types/jest": "^28.1.0",
|
||||
"@types/js-yaml": "^4.0.5",
|
||||
@ -67,7 +68,10 @@
|
||||
"vite": "^3.2.2",
|
||||
"vite-plugin-monaco-editor": "^1.1.0",
|
||||
"vite-plugin-svgr": "^2.2.2",
|
||||
"zrender": "^5.3.2"
|
||||
"zrender": "^5.3.2",
|
||||
"monaco-editor": "0.30.1",
|
||||
"react-overlays": "5.1.1",
|
||||
"copy-to-clipboard": "3.3.1"
|
||||
},
|
||||
"jest": {
|
||||
"verbose": true,
|
||||
|
@ -22,13 +22,21 @@ const settings = {
|
||||
globals: {}
|
||||
};
|
||||
|
||||
const external = id =>
|
||||
new RegExp(
|
||||
const external = id => {
|
||||
const result = new RegExp(
|
||||
`^(?:${Object.keys(dependencies)
|
||||
.concat([
|
||||
'react',
|
||||
'react-dom',
|
||||
'react-overlays',
|
||||
'warning',
|
||||
'tslib',
|
||||
'dom-helpers',
|
||||
'@restart/hooks',
|
||||
'entities',
|
||||
'linkify-it',
|
||||
'markdown-it',
|
||||
'prop-types',
|
||||
'markdown-it-html5-media',
|
||||
'mdurl',
|
||||
'uc.micro'
|
||||
@ -38,6 +46,13 @@ const external = id =>
|
||||
)
|
||||
.join('|')})`
|
||||
).test(id);
|
||||
|
||||
if (!result && ~id.indexOf('node_modules')) {
|
||||
console.log(id);
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
const input = './src/index.tsx';
|
||||
|
||||
/** 获取子包编译后的入口路径,需要使用相对路径 */
|
||||
|
@ -63,7 +63,6 @@
|
||||
"mobx-react": "^6.3.1",
|
||||
"mobx-state-tree": "^3.17.3",
|
||||
"moment": "^2.19.4",
|
||||
"monaco-editor": "0.30.1",
|
||||
"mpegts.js": "^1.6.10",
|
||||
"prop-types": "^15.6.1",
|
||||
"qrcode.react": "^3.1.0",
|
||||
|
@ -20,15 +20,28 @@ const settings = {
|
||||
globals: {}
|
||||
};
|
||||
|
||||
const external = id =>
|
||||
new RegExp(
|
||||
const external = id => {
|
||||
const result = new RegExp(
|
||||
`^(?:${Object.keys(dependencies)
|
||||
.concat([])
|
||||
.concat([
|
||||
'monaco-editor',
|
||||
'react',
|
||||
'react-dom',
|
||||
'rc-input-number',
|
||||
'@babel/runtime'
|
||||
])
|
||||
.map(value =>
|
||||
value.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&').replace(/-/g, '\\x2d')
|
||||
)
|
||||
.join('|')})`
|
||||
).test(id);
|
||||
|
||||
if (!result && ~id.indexOf('node_modules')) {
|
||||
console.log(id);
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
const input = './src/index.tsx';
|
||||
|
||||
/** 获取子包编译后的入口路径,需要使用相对路径 */
|
||||
|
@ -4,6 +4,7 @@ import handler from '../mock/index';
|
||||
import express, {query} from 'express';
|
||||
import setPrototypeOf from 'setprototypeof';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
const app = express();
|
||||
|
||||
function initExpress(req: any, res: any, next: any, callback: () => void) {
|
||||
@ -34,7 +35,22 @@ export default function mockApiPlugin(options: {} = {}): Plugin {
|
||||
|
||||
server.middlewares.use('/schema.json', (req, res, next) => {
|
||||
initExpress(req, res, next, () => {
|
||||
res.sendFile(path.resolve(__dirname, '../packages/amis/schema.json'));
|
||||
const filepath = path.resolve(
|
||||
__dirname,
|
||||
'../packages/amis/schema.json'
|
||||
);
|
||||
|
||||
if (!fs.existsSync(filepath)) {
|
||||
res.json({
|
||||
$schema: 'http://json-schema.org/draft-07/schema#',
|
||||
type: 'object',
|
||||
description:
|
||||
'amis/schema.json 还没有构建,请执行 `npm run build-schemas --workspace amis` 后看效果'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
res.sendFile(filepath);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user