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

build: current webpack config does not mimic the same functionality for global styles from Angular CLI #1070

Closed
christophercr opened this issue Jan 23, 2019 · 0 comments · Fixed by #1072

Comments

@christophercr
Copy link
Collaborator

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[X] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/NationalBankBelgium/stark/blob/master/CONTRIBUTING.md#got-a-question-or-problem

Current behavior

In an app generated using the Angular CLI project, the files containing global styles should be included in the angular.json file at projects -> your-app -> architect -> build -> options -> styles.

This way, when using the ng serve command, Webpack will build the app including a styles bundle and add it to the index.html so global styles work as expected.

This is not the case when using the stark-build package instead of Angular CLI. Right now the global styles should be directly imported in the app.module.ts otherwise Webpack will not include them in the build and it will not create the styles bundle for them.

Expected behavior

The stark-build should mimic the same functionality for global styles as Angular CLI.

Minimal reproduction of the problem with instructions

  1. Add a file with global styles under src/styles
  2. Add the location of the file with global styles to the angular.json of the app under projects -> your-app -> architect -> build -> options -> styles
  3. Make sure that you don't import the file with global styles anywhere in your app.
  4. Start the application running the npm start command.
  5. The global styles are not applied to the app because they are not even bundled by webpack

What is the motivation / use case for changing the behavior?

Make stark-build fully compatible (or as much as possible) with Angular CLI by respecting the API in the angular.json file.

Environment


Stark version: 10.0.0-beta.2

@christophercr christophercr added this to the 10.0.0-beta.3 milestone Jan 23, 2019
@christophercr christophercr self-assigned this Jan 23, 2019
christophercr added a commit to christophercr/stark that referenced this issue Jan 23, 2019
christophercr added a commit to christophercr/stark that referenced this issue Jan 23, 2019
…same functionality for global styles from Angular CLI

ISSUES CLOSED: NationalBankBelgium#1070
christophercr added a commit to christophercr/stark that referenced this issue Jan 23, 2019
…same functionality for global styles from Angular CLI

ISSUES CLOSED: NationalBankBelgium#1070

BREAKING CHANGE: global styles must be included in the angular.json
(standard Angular CLI behavior) instead of importing them directly in the app
christophercr added a commit to christophercr/stark that referenced this issue Jan 23, 2019
…same functionality for global styles from Angular CLI

ISSUES CLOSED: NationalBankBelgium#1070

BREAKING CHANGE: global styles must be included in the angular.json (standard Angular CLI behavior) instead of importing them directly in the app
christophercr added a commit to christophercr/stark that referenced this issue Jan 23, 2019
…same functionality for global styles from Angular CLI

ISSUES CLOSED: NationalBankBelgium#1070

BREAKING CHANGE: global styles must be included in the angular.json (standard Angular CLI behavior) instead of importing them directly in the app
christophercr added a commit to christophercr/stark that referenced this issue Jan 23, 2019
…l styles from angular.json to align with Angular CLI

ISSUES CLOSED: NationalBankBelgium#1070

BREAKING CHANGE: global styles must be included in the angular.json (standard Angular CLI behavior) instead of importing them directly in the app
christophercr added a commit to christophercr/stark that referenced this issue Jan 25, 2019
…l styles from angular.json to align with Angular CLI

ISSUES CLOSED: NationalBankBelgium#1070

BREAKING CHANGE: global styles must be included in the angular.json (standard Angular CLI behavior) instead of importing them directly in the app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant