fix: 修复 gh-pages 报 css 找不到的异常 (#6440)

This commit is contained in:
liaoxuezhi 2023-03-21 20:57:37 +08:00 committed by GitHub
parent 585c61df6b
commit 9e155db9b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 7 deletions

View File

@ -15,26 +15,26 @@
href="@fortawesome/fontawesome-free/css/v4-shims.css"
/>
<!--DEPENDENCIES_INJECT_PLACEHOLDER-->
<link rel="stylesheet" title="ang" href="amis-ui/scss/themes/ang.scss" />
<link rel="stylesheet" title="ang" href="amis/lib/themes/ang.css" />
<link
rel="stylesheet"
title="cxd"
disabled
href="amis-ui/scss/themes/cxd.scss"
href="amis/lib/themes/cxd.css"
/>
<link
rel="stylesheet"
title="dark"
disabled
href="amis-ui/scss/themes/dark.scss"
href="amis/lib/themes/dark.css"
/>
<link
rel="stylesheet"
title="antd"
disabled
href="amis-ui/scss/themes/antd.scss"
href="amis/lib/themes/antd.css"
/>
<link rel="stylesheet" href="amis-ui/scss/helper.scss" />
<link rel="stylesheet" href="amis/lib/helper.css" />
<style>
.app-wrapper {
position: relative;

View File

@ -869,7 +869,7 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'!fflate/**'
],
'pkg/npm.css': ['node_modules/*/**.css', '!monaco-editor/**'],
'pkg/npm.css': ['node_modules/*/**.css', '!monaco-editor/**', '!amis/**'],
// css 打包
'pkg/style.css': [
@ -880,6 +880,7 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'!/examples/style.scss',
'!monaco-editor/**',
'!scss/helper.scss',
'!amis/**',
'/examples/style.scss' // 让它在最下面
]
}),

View File

@ -14,7 +14,10 @@ export default function transformMobileHtml(options: {} = {}): Plugin {
apply: 'serve',
transformIndexHtml(html: string, file) {
if (file.path === '/examples/mobile.html') {
if (
file.path === '/examples/mobile.html' ||
file.path === '/examples/index.html'
) {
html = html.replace(/href=('|")(.*?)\1/g, (_, quote, value) => {
if (
/^(?:amis|amis\-core|amis\-formula|amis\-ui|office\-viewer)/.test(