Browse Source

chore: remove useless license.txt in the dist dir

代强 1 year ago
parent
commit
6ebc1b8a5e
1 changed files with 6 additions and 4 deletions
  1. 6 4
      packages/semi-ui/scripts/compileDist.js

+ 6 - 4
packages/semi-ui/scripts/compileDist.js

@@ -1,10 +1,11 @@
 const webpack = require('webpack');
 const config = require('../webpack.config');
-
+const fs = require("fs/promises");
+const path = require("path");
 function compile() {
     return new Promise((resolve, reject) => {
         console.log('compile jsx start');
-        webpack(config({ minimize: false }), (err, stats) => {
+        webpack(config({ minimize: false }), async (err, stats) => {
             if (err) {
                 console.error(err);
                 reject(err);
@@ -29,7 +30,7 @@ function compile() {
 function compileMin() {
     return new Promise((resolve, reject) => {
         console.log('compile jsx with minimize start');
-        webpack(config({ minimize: true }), (err, stats) => {
+        webpack(config({ minimize: true }), async (err, stats) => {
             if (err) {
                 console.error(err);
                 reject(err);
@@ -43,10 +44,11 @@ function compileMin() {
                     reject(err);
                 });
             }
+            await fs.unlink(path.join(__dirname, "..", 'dist', 'umd', 'semi-ui.min.js.LICENSE.txt'));
             console.log('compile jsx with minimize success');
             resolve();
         });
     });
 }
 
-compile().then(compileMin);
+compile().then(compileMin);