sdk 编译调整

This commit is contained in:
2betop 2022-06-07 12:45:10 +08:00
parent 5c5d03680e
commit 6cfe5b02c1
2 changed files with 24 additions and 29 deletions

View File

@ -6,12 +6,13 @@
rel="stylesheet"
href="@fortawesome/fontawesome-free/css/v4-shims.css"
/>
<link rel="stylesheet" title="ang" href="amis-ui/scss/helper.scss" />
<!--DEPENDENCIES_INJECT_PLACEHOLDER-->
<!--STYLE_PLACEHOLDER-->
<link rel="stylesheet" title="ang" href="../scss/themes/ang.scss" />
<link rel="stylesheet" title="cxd" href="../scss/themes/cxd.scss" />
<link rel="stylesheet" title="dark" href="../scss/themes/dark.scss" />
<link rel="stylesheet" title="antd" href="../scss/themes/antd.scss" />
<link rel="stylesheet" title="ang" href="amis-ui/scss/themes/ang.scss" />
<link rel="stylesheet" title="cxd" href="amis-ui/scss/themes/cxd.scss" />
<link rel="stylesheet" title="dark" href="amis-ui/scss/themes/dark.scss" />
<link rel="stylesheet" title="antd" href="amis-ui/scss/themes/antd.scss" />
</head>
<body>

View File

@ -302,7 +302,7 @@ if (fis.project.currentMedia() === 'publish-sdk') {
fis.on('compile:end', function (file) {
if (
file.subpath === '/src/index.tsx' ||
file.subpath === '/packages/amis/src/index.tsx' ||
file.subpath === '/examples/mod.js' ||
file.subpath === '/examples/loader.ts'
) {
@ -373,13 +373,6 @@ if (fis.project.currentMedia() === 'publish-sdk') {
}
});
env.match('/src/icons/**.svg', {
optimizer: fis.plugin('uglify-js'),
moduleId: function (m, path) {
return fis.util.md5(package.version + 'amis-sdk' + path);
}
});
env.match('::package', {
packager: fis.plugin('deps-pack', {
'sdk.js': [
@ -399,9 +392,9 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'!exceljs/**',
'!docsearch.js/**',
'!monaco-editor/**.css',
'!src/components/RichText.tsx',
'!src/components/Tinymce.tsx',
'!src/components/ColorPicker.tsx',
'!amis-ui/lib/components/RichText.js',
'!amis-ui/lib/components/Tinymce.js',
'!amis-ui/lib/components/ColorPicker.js',
'!react-color/**',
'!material-colors/**',
'!reactcss/**',
@ -409,10 +402,10 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'!cropperjs/**',
'!react-cropper/**',
'!jsbarcode/**',
'!src/components/BarCode.tsx',
'!src/lib/renderers/Form/CityDB.js',
'!src/components/Markdown.tsx',
'!src/utils/markdown.ts',
'!amis-ui/lib/components/BarCode.js',
'!amis-ui/lib/renderers/Form/CityDB.js',
'!amis-ui/lib/components/Markdown.js',
'!amis-core/lib/utils/markdown.js',
'!highlight.js/**',
'!entities/**',
'!linkify-it/**',
@ -423,9 +416,12 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'!punycode/**'
],
'rich-text.js': ['src/components/RichText.tsx', 'froala-editor/**'],
'rich-text.js': [
'amis-ui/lib/components/RichText.js',
'froala-editor/**'
],
'tinymce.js': ['src/components/Tinymce.tsx', 'tinymce/**'],
'tinymce.js': ['amis-ui/lib/components/Tinymce.js', 'tinymce/**'],
'codemirror.js': ['codemirror/**'],
'papaparse.js': ['papaparse/**'],
@ -433,8 +429,7 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'exceljs.js': ['exceljs/**'],
'markdown.js': [
'src/components/Markdown.tsx',
'src/utils/markdown.ts',
'amis-ui/lib/components/Markdown.js',
'highlight.js/**',
'entities/**',
'linkify-it/**',
@ -446,7 +441,7 @@ if (fis.project.currentMedia() === 'publish-sdk') {
],
'color-picker.js': [
'src/components/ColorPicker.tsx',
'amis-ui/lib/components/ColorPicker.js',
'react-color/**',
'material-colors/**',
'reactcss/**',
@ -467,12 +462,11 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'!hls.js/**',
'!froala-editor/**',
'!src/components/RichText.tsx',
'!amis-ui/lib/components/RichText.js',
'!zrender/**',
'!echarts/**',
'!papaparse/**',
'!exceljs/**',
'!src/utils/markdown.ts',
'!highlight.js/**',
'!argparse/**',
'!entities/**',
@ -508,7 +502,7 @@ if (fis.project.currentMedia() === 'publish-sdk') {
// 替换 worker 地址的路径,让 sdk 加载同目录下的文件。
// 如果 sdk 和 worker 不是部署在一个地方,请通过指定 MonacoEnvironment.getWorkerUrl
if (
file.subpath === '/src/components/Editor.tsx' ||
file.subpath === '/node_modules/amis-ui/lib/components/Editor.js' ||
file.subpath === '/examples/loadMonacoEditor.ts'
) {
contents = contents.replace(
@ -794,11 +788,11 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'pkg/style.css': [
'*.scss',
'*.css',
'!/scss/themes/*.scss',
'!scss/themes/*.scss',
// 要切换主题,不能打在一起。'/scss/*.scss',
'!/examples/style.scss',
'!monaco-editor/**',
'!/scss/helper.scss',
'!scss/helper.scss',
'/examples/style.scss' // 让它在最下面
]
}),