Skip to content

Commit 9e155db

Browse files
authored
fix: 修复 gh-pages 报 css 找不到的异常 (#6440)
1 parent 585c61d commit 9e155db

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

examples/mobile.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,26 @@
1515
href="@fortawesome/fontawesome-free/css/v4-shims.css"
1616
/>
1717
<!--DEPENDENCIES_INJECT_PLACEHOLDER-->
18-
<link rel="stylesheet" title="ang" href="amis-ui/scss/themes/ang.scss" />
18+
<link rel="stylesheet" title="ang" href="amis/lib/themes/ang.css" />
1919
<link
2020
rel="stylesheet"
2121
title="cxd"
2222
disabled
23-
href="amis-ui/scss/themes/cxd.scss"
23+
href="amis/lib/themes/cxd.css"
2424
/>
2525
<link
2626
rel="stylesheet"
2727
title="dark"
2828
disabled
29-
href="amis-ui/scss/themes/dark.scss"
29+
href="amis/lib/themes/dark.css"
3030
/>
3131
<link
3232
rel="stylesheet"
3333
title="antd"
3434
disabled
35-
href="amis-ui/scss/themes/antd.scss"
35+
href="amis/lib/themes/antd.css"
3636
/>
37-
<link rel="stylesheet" href="amis-ui/scss/helper.scss" />
37+
<link rel="stylesheet" href="amis/lib/helper.css" />
3838
<style>
3939
.app-wrapper {
4040
position: relative;

fis-conf.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ if (fis.project.currentMedia() === 'publish-sdk') {
869869
'!fflate/**'
870870
],
871871

872-
'pkg/npm.css': ['node_modules/*/**.css', '!monaco-editor/**'],
872+
'pkg/npm.css': ['node_modules/*/**.css', '!monaco-editor/**', '!amis/**'],
873873

874874
// css 打包
875875
'pkg/style.css': [
@@ -880,6 +880,7 @@ if (fis.project.currentMedia() === 'publish-sdk') {
880880
'!/examples/style.scss',
881881
'!monaco-editor/**',
882882
'!scss/helper.scss',
883+
'!amis/**',
883884
'/examples/style.scss' // 让它在最下面
884885
]
885886
}),

scripts/transformMobileHtml.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ export default function transformMobileHtml(options: {} = {}): Plugin {
1414
apply: 'serve',
1515

1616
transformIndexHtml(html: string, file) {
17-
if (file.path === '/examples/mobile.html') {
17+
if (
18+
file.path === '/examples/mobile.html' ||
19+
file.path === '/examples/index.html'
20+
) {
1821
html = html.replace(/href=('|")(.*?)\1/g, (_, quote, value) => {
1922
if (
2023
/^(?:amis|amis\-core|amis\-formula|amis\-ui|office\-viewer)/.test(

0 commit comments

Comments
 (0)