Remove package.json dependencies during build

The kibana app itself requires that package.json exist, so removing it
entirely from distributions is a no go. Instead, we remove only the
dependencies themselves from the package.json so people do not try to
reinstall dependencies on an official distribution.
This commit is contained in:
Court Ewing 2015-09-18 14:20:07 -04:00
parent bd8ce389b9
commit e2dd40e965
2 changed files with 13 additions and 0 deletions

View file

@ -13,6 +13,7 @@ module.exports = function (grunt) {
'_build:packageJson',
'_build:readme',
'_build:installNpmDeps',
'_build:removePkgJsonDeps',
'clean:testsFromModules',
'clean:deepModuleBins',
'clean:deepModules',

View file

@ -0,0 +1,12 @@
module.exports = function (grunt) {
grunt.registerTask('_build:removePkgJsonDeps', function () {
const pkg = grunt.file.readJSON('build/kibana/package.json');
delete pkg.dependencies;
grunt.file.write(
'build/kibana/package.json',
JSON.stringify(pkg, null, ' ')
);
});
};