chore: vite 模式下 moible 预览资源引用改成源码 (#6483)

This commit is contained in:
liaoxuezhi 2023-03-28 15:54:11 +08:00 committed by GitHub
parent dfb6587b87
commit e7c5b73d0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,7 +19,11 @@ export default function transformMobileHtml(options: {} = {}): Plugin {
file.path === '/examples/index.html'
) {
html = html.replace(/href=('|")(.*?)\1/g, (_, quote, value) => {
if (
if (/^amis\/lib\/themes\/(.*)\.css$/.test(value)) {
return `href=${quote}../../packages/amis-ui/scss/themes/${RegExp.$1}.scss${quote}`;
} else if (/^amis\/lib\/helper\.css$/.test(value)) {
return `href=${quote}../../packages/amis-ui/scss/helper.scss${quote}`;
} else if (
/^(?:amis|amis\-core|amis\-formula|amis\-ui|office\-viewer)/.test(
value
)