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

feat(@angular-devkit/build-angular): validate file extensions for scripts and styles options #22613

Merged
merged 1 commit into from
Jan 31, 2022
Merged

feat(@angular-devkit/build-angular): validate file extensions for scripts and styles options #22613

merged 1 commit into from
Jan 31, 2022

Conversation

alan-agius4
Copy link
Collaborator

@alan-agius4 alan-agius4 commented Jan 31, 2022

In some cases unexpected files may be provided which can cause to unsupported or broken behaviour.

One such use-case is users can provide TypeScript files as scripts input, this would not be processed by the TypeScript compiler, see: #17125 and would cause the build to fail with a an unhelpful error message during optimization as the JS optimizers cannot parse TypeScript input.

BREAKING CHANGE:

Browser builder script and styles options input files extensions are now validated.

Valid extensions for scripts are:

  • .js
  • .cjs
  • .mjs
  • .jsx
  • .cjsx
  • .mjsx

Valid extensions for styles are:

  • .css
  • .less
  • .sass
  • .scss
  • .styl

@alan-agius4 alan-agius4 added the target: major This PR is targeted for the next major release label Jan 31, 2022
@alan-agius4 alan-agius4 changed the title fix(@angular-devkit/build-angular): valid file extensions for scripts and styles options fix(@angular-devkit/build-angular): validate file extensions for scripts and styles options Jan 31, 2022
@alan-agius4 alan-agius4 changed the title fix(@angular-devkit/build-angular): validate file extensions for scripts and styles options feat(@angular-devkit/build-angular): validate file extensions for scripts and styles options Jan 31, 2022
…ripts` and `styles` options

In some cases unexpected files may be provided which can cause to unsupported or broken behaviour.

One such use-case is users can provide TypeScript files as `scripts` input, this would not be processed by the TypeScript compiler, see: #17125 and would cause the build to fail with a an unhelpful error message during optimization as the JS optimizers cannot parse TypeScript input.

BREAKING CHANGE:

`browser` and `karma` builders `script` and `styles` options input files extensions are now validated.

Valid extensions for `scripts` are:
- `.js`
- `.cjs`
- `.mjs`
- `.jsx`
- `.cjsx`
- `.mjsx`

Valid extensions for `styles` are:
- `.css`
- `.less`
- `.sass`
- `.scss`
- `.styl`
@alan-agius4 alan-agius4 added the action: merge The PR is ready for merge by the caretaker label Jan 31, 2022
@dgp1130 dgp1130 merged commit d23a168 into angular:master Jan 31, 2022
@alan-agius4 alan-agius4 deleted the valid-file-ext-for-script-styles branch January 31, 2022 19:58
@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 Mar 3, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker flag: breaking change target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants