Hi there,
Which is the difference between this two command:
./vendor/bin/jigsaw build production && npm run production?
I have deployed a site on Netlify and I'm using a function which is served with netlify-lambda build <folder>.
Now I have to attach this command to the build production. Could you someone help me with that?
The documentation says that you guys use this approach to deploy on Github pages but I can't see anything that explains the difference between this two command.
Maybe there is no different, but I'm new so please be patient.
./vendor/bin/jigsaw build production runs Jigsaw's build command to create the production files for your site, but it doesn't run any npm scripts鈥攎eaning if you have any asset compilation steps to run (e.g. running CSS through a pre-processor like Less or Sass, or compiling JS), build will not run those. npm run production runs the production script that's in package.json, which triggers webpack and runs your asset compilation, _as well as_ running ./vendor/bin/jigsaw build.So:
./vendor/bin/jigsaw build => builds site files onlynpm run production => processes assets & builds site files@damiani thanks for your fast reply.
Now it's more clear to me and very useful too,
Thanks.
Most helpful comment
./vendor/bin/jigsaw build productionruns Jigsaw'sbuildcommand to create the production files for your site, but it doesn't run anynpmscripts鈥攎eaning if you have any asset compilation steps to run (e.g. running CSS through a pre-processor like Less or Sass, or compiling JS),buildwill not run those.npm run productionruns theproductionscript that's inpackage.json, which triggers webpack and runs your asset compilation, _as well as_ running./vendor/bin/jigsaw build.So:
./vendor/bin/jigsaw build=> builds site files onlynpm run production=> processes assets & builds site files