Skip to content

Commit

Permalink
Merge 38bd2ff into 00034ef
Browse files Browse the repository at this point in the history
  • Loading branch information
oshi97 committed Jul 1, 2021
2 parents 00034ef + 38bd2ff commit d9e4e02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 25 deletions.
32 changes: 8 additions & 24 deletions static/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
const webpackConfig = require('./webpack-config');
const { exec } = require("child_process");
const jamboConfig = require('./jambo.json');

const outputDir = jamboConfig.dirs.output;
const { spawnSync } = require('child_process');

module.exports = function (grunt) {
const webpackConfig = require('./webpack-config');
const jamboConfig = require('./jambo.json');

const outputDir = jamboConfig.dirs.output;
grunt.initConfig({
webpack: {
myConfig: webpackConfig
},
watch: {
all: {
files: ['**', '!**/node_modules/**', `!${outputDir}/**`],
tasks: ['jambobuild', 'webpack',],
tasks: ['build',],
options: {
spawn: false,
},
Expand All @@ -23,23 +23,7 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-webpack');
grunt.loadNpmTasks('grunt-contrib-watch');

grunt.registerTask('jambobuild', 'Jambo build.',
function() {
// Force task into async mode and grab a handle to the "done" function.
var done = this.async();
// Run some sync stuff.
grunt.log.writeln('Processing task...');
// And some async stuff.
exec('npx jambo build', (error, stdout, stderr) => {
if (error) {
console.log(error.message);
done(false);
return;
}

stderr && console.error(stderr);
stdout && console.log(stdout);
done();
});
grunt.registerTask('build', 'jambo build -> grunt webpack', () => {
spawnSync('npm', ['run', 'build', '--silent'], { stdio: 'inherit' });
});
}
3 changes: 2 additions & 1 deletion static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Toolchain for use with the HH Theme",
"main": "Gruntfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"build": "jambo build && grunt webpack"
},
"author": "tmeyer@yext.com",
"license": "BSD-3-Clause",
Expand Down

0 comments on commit d9e4e02

Please sign in to comment.