Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Path to ngsw-config.json #10793

Closed
zygimantas opened this issue May 10, 2018 · 5 comments · Fixed by #13346
Closed

Path to ngsw-config.json #10793

zygimantas opened this issue May 10, 2018 · 5 comments · Fixed by #13346
Assignees

Comments

@zygimantas
Copy link

Versions

Angular CLI: 6.0.0
Node: 10.0.0
OS: win32 x64
Angular: 6.0.0
... cli, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router, service-worker

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.0
@angular-devkit/build-angular     0.6.0
@angular-devkit/build-optimizer   0.6.0
@angular-devkit/core              0.6.0
@angular-devkit/schematics        0.6.0
@ngtools/webpack                  6.0.0
@schematics/angular               0.6.0
@schematics/update                0.6.0
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.6.0

Observed behavior

ngsw-config.json must be in src/ directory

Desired behavior

There may be multiple apps configured in angular.json, so the path ngsw-config.json should be configurable also; ngsw-config.json should not be shared across different apps; file name should be configurable;

@menosprezzi
Copy link

I suggest also a custom path to ngsw-config.json as we see in other config files in angular.json

@mackelito
Copy link

Correct me if I'm wrong but if we run 'ng add @angular/pwa --project project-name' the ngsw-config is added to root '/' right?

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Dec 28, 2018

There is already an option to specify the ngsw config path location. This is called ngswConfigPath which can also be specified in the build options https://angular.io/cli/build

That said, maybe we should generate ngsw-config.json under the project sourceRoot if root is empty similar to the karma.conf.js

Proposed:

-- src
---- ngsw-config.json
-- project
---- app
------ ngsw-config.json

Current:

-- ngsw-config.json
-- src
-- project
---- app
------ ngsw-config.json

@clydin, @filipesilva, what do you reckon?

@filipesilva
Copy link
Contributor

@alan-agius4 yes, I agree it should be like your proposal. Similar config files are also under src/.

@alan-agius4 alan-agius4 self-assigned this Dec 30, 2018
alexeagle pushed a commit that referenced this issue Jan 8, 2019
Generate `ngsw-config.json` under the project sourceRoot if root is empty similar to the `karma.conf.js`

Now:
```
-- src
---- ngsw-config.json
-- project
---- app
------ ngsw-config.json
```
Current:
```
-- ngsw-config.json
-- src
-- project
---- app
------ ngsw-config.json
```

Fixes #10793
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants