Skip to content

Commit

Permalink
Fix Grunt memory leak (#907)
Browse files Browse the repository at this point in the history
Fix the grunt memory leak by isolating the jambo and webpack build into their own process

J=SLAP-1484
TEST=manual

Run "grunt watch" and confirm the build runs when files change
  • Loading branch information
cea2aj committed Aug 5, 2021
1 parent d65dd87 commit 9892543
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions static/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,17 @@ module.exports = function (grunt) {
watch: {
all: {
files: ['**', '!**/node_modules/**', `!${outputDir}/**`],
tasks: ['build',],
tasks: ['build-site'],
options: {
spawn: false,
},
},
},
});

grunt.loadNpmTasks('grunt-webpack');
grunt.loadNpmTasks('grunt-contrib-watch');

grunt.registerTask('build', 'jambo build -> grunt webpack', () => {
grunt.registerTask('build-site', 'Builds the site', () => {
spawnSync('npm', ['run', 'build', '--silent'], { stdio: 'inherit' });
});
}
}
2 changes: 1 addition & 1 deletion static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "Gruntfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "jambo build && grunt webpack"
"build": "jambo build && webpack --config webpack-config.js"
},
"author": "tmeyer@yext.com",
"license": "BSD-3-Clause",
Expand Down

0 comments on commit 9892543

Please sign in to comment.