Hi,
I've to an issue when trying to build a JET web application where it seems like the command line parameters used in the build command are visible in the before_build.js hook but aren't visible in the after_build.js hook.
I've just created a basic web application using the basic template (no other changes). I've then modified the before_build.js and after_build.js hook files to log the configObj (files listed below).
When I run the build command below, I get the build type and --user-options logged in the before_build.js hook but not the after_build.js hook (see build command output).
Am I doing something wrong or is there some bug?
before_build.js file
'use strict';
module.exports = function (configObj) {
return new Promise((resolve, reject) => {
console.log("Running before_build hook.");
console.log(configObj);
resolve(configObj);
});
};
after_build.js file
'use strict';module.exports = function (configObj) {
return new Promise((resolve, reject) => {
console.log("Running after_build hook.");
console.log(configObj);
resolve(configObj);
});
};
Build command I'm running: ojet build --user-options="ENV=UAT" --release
Build command output: Warning: Command is missing platform. Default to web.
Cleaning staging path.
Running before_build hook.
{ platform: 'web',
theme:
{ name: 'alta',
platform: 'web',
compile: false,
version: '8.1.0' },
buildType: 'release',
userOptions: 'ENV=UAT',
requireJs:
{ baseUrl: 'web/js',
name: 'bundle-temp',
optimize: 'none',
out: 'web/js/bundle.js' },
requireJsEs5:
{ baseUrl: 'web/js',
name: 'bundle-temp_es5',
optimize: 'none',
out: 'web/js/bundle_es5.js' },
isRequireJsEs5: undefined,
paths:
{ src:
{ common: 'src',
javascript: 'js',
typescript: 'ts',
styles: 'css',
themes: 'themes',
web: 'src-web',
hybrid: 'src-hybrid',
platformSpecific: 'src-web' },
staging:
{ web: 'web',
hybrid: 'hybrid',
themes: 'staged-themes',
stagingPath: 'web' },
components: 'jet_components',
composites: 'jet-composites' } }
Copy files to staging directory.
Copy finished.
Copy library files to staging directory.
Copy finished.
Copy reference components to staging directory.
Copy finished.
Copy local web components
Copy local web components skipped
Optimizing svg into SVG sprites.
Svg optimization task finished.
Compiling sass...
Sass compile finished.
Task index.html cdn bundle injection finished.
Running theme injection task.
Task index.html theme path injection finished.
Running theme copy task.
Theme copy task finished.
Running injection tasks.
Task main.js paths injection finished.
Running injection tasks for es5.
Task main.js paths injection finished.
Running before_release_build hook.
Running terser task.
Task terser finished.
Running requirejs task.
Running before_optimize hook.
Task requirejs finished *.
Running requirejs tasks for ES5.
Running before_optimize hook.
Task requirejs ES5 finished *.
Copying main.js
Copy main.js finished
Cleaning temporary files.
Task cleaning temporary files finished.
runAllComponentHooks
Running after_build hook.
{ paths:
{ src:
{ common: 'src',
javascript: 'js',
typescript: 'ts',
styles: 'css',
themes: 'themes',
web: 'src-web',
hybrid: 'src-hybrid',
platformSpecific: 'src-web' },
staging:
{ web: 'web',
hybrid: 'hybrid',
themes: 'staged-themes',
stagingPath: 'web' },
components: 'jet_components',
composites: 'jet-composites' } }
Build finished.