diff --git a/scripts/build.js b/scripts/build.js index 0af923224903..b264928c5f64 100644 --- a/scripts/build.js +++ b/scripts/build.js @@ -82,6 +82,10 @@ function buildBrowserPackage(p) { const srcDir = path.resolve(p, SRC_DIR); const pkgJsonPath = path.resolve(p, 'package.json'); + if (!fs.existsSync(pkgJsonPath)) { + return; + } + const {browser} = require(pkgJsonPath); if (browser) { if (browser.indexOf(BUILD_ES5_DIR) !== 0) {