Skip to content

Instantly share code, notes, and snippets.

@webmaxru
Created November 4, 2017 00:06
Show Gist options
  • Select an option

  • Save webmaxru/5ef2fbc1cb18ef38af4a1c84936261a8 to your computer and use it in GitHub Desktop.

Select an option

Save webmaxru/5ef2fbc1cb18ef38af4a1c84936261a8 to your computer and use it in GitHub Desktop.
Emulate Angular 1.6 NGSW build support
{
...
"scripts": {
...
"ngsw-config": "node_modules/.bin/ngsw-config dist src/ngsw-config.json",
"ngsw-copy": "cp node_modules/@angular/service-worker/ngsw-worker.js dist/",
"build-prod-ngsw": "ng build --prod && npm run ngsw-config && npm run ngsw-copy",
"serve-prod-ngsw": "npm run build-prod-ngsw && http-server dist -p 8080"
}
}
@zuber-edvantics

Copy link
Copy Markdown

this script "ngsw-copy": "cp node_modules/@angular/service-worker/ngsw-worker.js dist/", has raised

'cp' is not recognized as an internal or external command,
operable program or batch file.

in window cmd prompt. Please help.

@pacellyjcax

Copy link
Copy Markdown

@zuber-edvantics if you're using the cmd prompt on windows the proper command to copy a file it is 'copy' not the linux default 'cp', but if you want to use the 'cp' anyway you can use the command as it is on the powershell prompt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment