From a32896a73b58c0e9d7cf69f962233e3903a4fc3d Mon Sep 17 00:00:00 2001 From: leezng Date: Mon, 4 Mar 2024 22:44:27 +0800 Subject: [PATCH] feat: use spawn to build esm --- .gitignore | 1 + build/build.js | 8 ++++++++ package.json | 1 + 3 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index 95eb21b..1a56824 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ node_modules/ example-dist/ dist/ lib/ +esm/ types/ npm-debug.log* yarn-debug.log* diff --git a/build/build.js b/build/build.js index ba556e8..804aad3 100644 --- a/build/build.js +++ b/build/build.js @@ -39,6 +39,14 @@ webpack(webpackConfig, (err, stats) => { ), ); } else { + const buildEsmProcess = spawn('npm', ['run', 'build:esm'], { + stdio: 'inherit', + }); + + buildEsmProcess.on('close', () => { + console.log(chalk.cyan('Build esm complete.\n')); + }); + const buildTypesProcess = spawn('npm', ['run', 'build:dts'], { stdio: 'inherit', }); diff --git a/package.json b/package.json index 7b35be8..8325362 100644 --- a/package.json +++ b/package.json @@ -93,6 +93,7 @@ ], "files": [ "lib", + "esm", "types" ], "peerDependencies": {