diff --git a/package.json b/package.json index d40d20f..6b11929 100644 --- a/package.json +++ b/package.json @@ -106,7 +106,15 @@ "changelogFile": "CHANGELOG.md" } ], - "@semantic-release/npm", + [ + "@semantic-release/npm", + { + "npmPublish": true, + "tarballDir": false, + "pkgRoot": ".", + "provenance": true + } + ], "@semantic-release/github" ] } diff --git a/scripts/build-mjml-react.ts b/scripts/build-mjml-react.ts index 9083e69..f2d2b56 100644 --- a/scripts/build-mjml-react.ts +++ b/scripts/build-mjml-react.ts @@ -15,7 +15,15 @@ function moveFilesToDist() { const destination = `dist/${fileToCopy}`; if (fileToCopy === "package.json") { const file = fs.readFileSync(fileToCopy); - fs.writeFileSync(destination, file.toString().replace(/dist\//g, "")); + const packageJson = JSON.parse(file.toString().replace(/dist\//g, "")); + + // Remove fields that shouldn't be in the published package + delete packageJson.devDependencies; + delete packageJson.scripts; + delete packageJson.release; // Remove semantic-release config! + delete packageJson.packageManager; + + fs.writeFileSync(destination, JSON.stringify(packageJson, null, 2)); } else { fs.copyFileSync(fileToCopy, destination); }