@umoteam/editor-external 4.0.0 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build.js CHANGED
@@ -36,7 +36,8 @@ const copyDir = (sourcePath, targetPath) => {
36
36
  const files = [
37
37
  { from: 'imgly/background-removal-data', to: 'imgly/background-removal-data', npm: false },
38
38
  { from: 'monaco-editor/min', to: 'monaco-editor/min' },
39
- { from: 'katex/dist', to: 'katex' }
39
+ { from: 'katex/dist', to: 'katex' },
40
+ { from: 'mammoth/mammoth.browser.min.js', to: 'mammoth/mammoth.browser.min.js' }
40
41
  ];
41
42
 
42
43
  // 循环遍历每个要复制的文件或目录
@@ -46,6 +47,9 @@ files.forEach((item) => {
46
47
 
47
48
  // 如果是文件,使用fs.copyFileSync
48
49
  if (fs.existsSync(sourcePath) && fs.statSync(sourcePath).isFile()) {
50
+ if (!fs.existsSync(targetPath)) {
51
+ fs.mkdirSync(path.dirname(targetPath), { recursive: true });
52
+ }
49
53
  fs.copyFileSync(sourcePath, targetPath);
50
54
  console.log(`Copied file: ${sourcePath} to ${targetPath}`);
51
55
  }