Merge pull request #10357 from allenve/master

fix: amis sdk 编译
This commit is contained in:
Allen 2024-05-31 15:35:02 +08:00 committed by GitHub
commit 218619704a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -146,7 +146,20 @@ fis.match('/node_modules/**.{js,cjs}', {
isMod: true,
rExt: 'js'
});
fis.set('project.fileType.text', 'cjs');
fis.match('pdfjs-dist/**.mjs', {
isMod: true,
rExt: 'js',
parser: fis.plugin('typescript', {
sourceMap: false,
importHelpers: true,
esModuleInterop: true,
emitDecoratorMetadata: false,
experimentalDecorators: false
})
});
fis.set('project.fileType.text', 'cjs,mjs');
fis.match('tinymce/{tinymce.js,plugins/**.js,themes/silver/theme.js}', {
ignoreDependencies: true
@ -254,7 +267,7 @@ fis.match('*.html:jsx', {
// 这些用了 esm
fis.match(
'{echarts/**.js,zrender/**.js,echarts-wordcloud/**.js,markdown-it-html5-media/**.js,react-hook-form/**.js,qrcode.react/**.js,axios/**.js,downshift/**.js,react-intersection-observer/**.js}',
'{echarts/**.js,zrender/**.js,echarts-wordcloud/**.js,markdown-it-html5-media/**.js,react-hook-form/**.js,qrcode.react/**.js,axios/**.js,downshift/**.js,react-intersection-observer/**.js,react-pdf/**.js}',
{
parser: fis.plugin('typescript', {
sourceMap: false,
@ -343,7 +356,7 @@ fis.hook('node_modules', {
});
fis.hook('commonjs', {
sourceMap: false,
extList: ['.js', '.jsx', '.tsx', '.ts', '.cjs'],
extList: ['.js', '.jsx', '.tsx', '.ts', '.cjs', '.mjs'],
paths: {
'monaco-editor': '/examples/loadMonacoEditor'
}
@ -505,6 +518,8 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'!amis-ui/lib/components/Tinymce.js',
'!amis-ui/lib/components/ColorPicker.js',
'!amis-ui/lib/components/PdfViewer.js',
'!react-pdf/**',
'!pdfjs-dist/**',
'!react-color/**',
'!material-colors/**',
'!reactcss/**',
@ -564,10 +579,7 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'tinycolor2/**'
],
'pdf-viewer.js': [
'amis-ui/lib/components/PdfViewer.js',
'pdfjs-dist/build/pdf.worker.min.js'
],
'pdf-viewer.js': ['amis-ui/lib/components/PdfViewer.js', 'react-pdf/**'],
'cropperjs.js': ['cropperjs/**', 'react-cropper/**'],
@ -591,8 +603,8 @@ if (fis.project.currentMedia() === 'publish-sdk') {
'!mpegts.js/**',
'!hls.js/**',
'!froala-editor/**',
'!react-pdf/**',
'!pdfjs-dist/**',
'!amis-ui/lib/components/RichText.js',
'!zrender/**',
'!echarts/**',