diff --git a/scripts/cp-pkgs.js b/scripts/cp-pkgs.js index a1a9480834a..884a88afa03 100644 --- a/scripts/cp-pkgs.js +++ b/scripts/cp-pkgs.js @@ -116,10 +116,15 @@ function dtsBundler() { if (error) { return; } + const isAllInOne = packageDirectory === ALL_IN_ONE_PACKAGE; + if (!isAllInOne) { + // Only the all-in-one package should generate a d.ts bundle + return; + } + // d.ts file exists const packagePath = path.join(PACKAGES_DIRECTORY, packageDirectory); const name = JSON.parse(fs.readFileSync(path.join(packagePath, 'package.json'), 'utf8')).name; - const isAllInOne = packageDirectory === ALL_IN_ONE_PACKAGE; const destBasename = isAllInOne ? packageDirectory : `mdc.${toCamelCase(packageDirectory.replace(/^mdc-/, ''))}`; const destFilename = path.join(packagePath, 'dist', `${destBasename}.d.ts`); diff --git a/scripts/verify-pkg-main.js b/scripts/verify-pkg-main.js index 9cff585016a..90d347dd6eb 100644 --- a/scripts/verify-pkg-main.js +++ b/scripts/verify-pkg-main.js @@ -90,7 +90,9 @@ globSync('packages/*/package.json').forEach((jsonPath) => { } verifyPath(packageJson, jsonPath, 'main'); verifyPath(packageJson, jsonPath, 'module'); - verifyPath(packageJson, jsonPath, 'types'); + if (jsonPath.includes('material-components-web')) { + verifyPath(packageJson, jsonPath, 'types'); + } }); if (invalidMains > 0 || invalidModules > 0 || invalidTypes > 0) {