同步操作将从 百度开源/amis 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
import MagicString from 'magic-string';import type {Plugin} from 'vite';/*** 因为这个 mobile.html 也作用于 fis3 编译,不能直接修改源码* 所以靠这个插件来改成让 vite 支持* @param options* @returns*/export default function transformMobileHtml(options: {} = {}): Plugin {return {name: 'amis-transform-mobile-html',enforce: 'pre',apply: 'serve',transformIndexHtml(html: string, file) {if (file.path === '/examples/mobile.html' ||file.path === '/examples/index.html') {html = html.replace(/href=('|")(.*?)1円/g, (_, quote, value) => {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)) {return `href=${quote}../../packages/${value}${quote}`;} else if (value[0] !== '.' && value[0] !== '/') {return `href=${quote}../../node_modules/${value}${quote}`;}return _;});const script = '<script type="text/javascript">';const idx = html.lastIndexOf(script);if (~idx) {html =html.substring(0, idx) +'<script type="module">' +html.substring(idx + script.length);}html = html.replace("amis.require(['./mobile.jsx'], function (app)","import('./mobile.jsx').then(function (app)");}return html;}};}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。