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" href="@fortawesome/fontawesome-free/css/v4-shims.css"
/> />
<!--DEPENDENCIES_INJECT_PLACEHOLDER--> <!--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 <link
rel="stylesheet" rel="stylesheet"
title="cxd" title="cxd"
disabled disabled
href="amis-ui/scss/themes/cxd.scss" href="amis/lib/themes/cxd.css"
/> />
<link <link
rel="stylesheet" rel="stylesheet"
title="dark" title="dark"
disabled disabled
href="amis-ui/scss/themes/dark.scss" href="amis/lib/themes/dark.css"
/> />
<link <link
rel="stylesheet" rel="stylesheet"
title="antd" title="antd"
disabled 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> <style>
.app-wrapper { .app-wrapper {
position: relative; position: relative;

View File

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

View File

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