@@ -6,7 +6,7 @@ const { default: Bundler, ValidateRawConfig, MergeRawConfigs } = require("@userf
66const { default : minifyJs } = require ( "gulp-uglify-es" ) ;
77const { execSync } = require ( "child_process" ) ;
88const { readFileSync, existsSync, writeFileSync } = require ( "fs" ) ;
9- const { resolve : resolvePath } = require ( "path" ) ;
9+ const { resolve : resolvePath , normalize : normalisePath } = require ( "path" ) ;
1010const { src, dest, series } = require ( "gulp" ) ;
1111const { sync : deleteSync } = require ( "del" ) ;
1212const concatCss = require ( "gulp-concat-css" ) ;
@@ -43,6 +43,7 @@ const publicAssetsDir = rootDir + "public/assets/";
4343const legacyVendorAssetsGlob = rootDir + "sprinkles/*/assets/vendor/**" ;
4444const sprinkleBundleFile = "asset-bundles.json" ;
4545const vendorAssetsDir = rootDir + "app/assets/" ;
46+ const buildDirFromVendorAssetsDir = "../../build/" ;
4647
4748// Load sprinkles
4849let sprinkles ;
@@ -88,14 +89,14 @@ async function assetsInstall() {
8889
8990 // Perform installation
9091 // NPM will automatically remove extraneous packages (barring algorithm failure) during install
91- Logger ( "Running npm install" ) ;
92+ Logger ( "Running npm install (using npm from PATH) " ) ;
9293 execSync ( "npm install" , {
9394 cwd : vendorAssetsDir ,
9495 stdio : doILog ? "inherit" : ""
9596 } ) ;
9697
9798 // Conduct audit
98- Logger ( "Running npm audit" ) ;
99+ Logger ( "Running npm audit (using npm from PATH) " ) ;
99100 try {
100101 execSync ( "npm audit" , {
101102 cwd : vendorAssetsDir ,
@@ -107,7 +108,7 @@ async function assetsInstall() {
107108 }
108109
109110 // Browserify dependencies
110- Logger ( "Running browserify against npm dependencies with a main entrypoint" ) ;
111+ Logger ( "Running browserify against npm dependencies with a compatible main entrypoint" ) ;
111112 deleteSync ( vendorAssetsDir + "browser_modules/" , { force : true } ) ;
112113 await browserifyDependencies ( {
113114 dependencies : Object . keys ( pkg . dependencies ) ,
@@ -155,7 +156,7 @@ async function assetsInstall() {
155156 // Perform installation
156157 Logger ( "Running bower install -q --allow-root" ) ;
157158 // --allow-root stops bower from complaining about being in 'sudo' in various situations
158- execSync ( " bower install -q --allow-root", {
159+ execSync ( normalisePath ( buildDirFromVendorAssetsDir + "node_modules/.bin/ bower" ) + " install -q --allow-root", {
159160 cwd : vendorAssetsDir ,
160161 stdio : doILog ? "inherit" : ""
161162 } ) ;
0 commit comments