Skip to content

Commit 7eac932

Browse files
authored
Release: remove scripts and dev deps from dist package.json
- this became necessary due to the addition of the prepare script - scripts aren't needed and don't work in the dist repo Close gh-5404
1 parent 3b963a2 commit 7eac932

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

build/release/dist.js

+14-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ module.exports = function( Release, files, complete ) {
1515
const extras = [
1616
"src",
1717
"LICENSE.txt",
18-
"AUTHORS.txt",
19-
"package.json"
18+
"AUTHORS.txt"
2019
];
2120

2221
/**
@@ -101,6 +100,19 @@ module.exports = function( Release, files, complete ) {
101100
shell.rm( "-f", `${ Release.dir.dist }/src/wrapper.js` );
102101
shell.rm( "-f", `${ Release.dir.dist }/src/.eslintrc.json` );
103102

103+
// Write package.json
104+
// Remove scripts and other superfluous properties,
105+
// especially the prepare script, which fails on the dist repo
106+
const packageJson = Object.assign( {}, pkg );
107+
delete packageJson.scripts;
108+
delete packageJson.devDependencies;
109+
delete packageJson.dependencies;
110+
delete packageJson.commitplease;
111+
await fs.writeFile(
112+
`${ Release.dir.dist }/package.json`,
113+
JSON.stringify( packageJson, null, 2 )
114+
);
115+
104116
// Write generated bower file
105117
await fs.writeFile( `${ Release.dir.dist }/bower.json`, generateBower() );
106118

0 commit comments

Comments
 (0)