Skip to content

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

Merged
dgp1130 merged 1 commit into
angular:masterfrom
alan-agius4:valid-file-ext-for-script-styles
Jan 31, 2022
Merged

dgp1130 merged 1 commit into
angular:masterfrom
alan-agius4:valid-file-ext-for-script-styles

Conversation

@alan-agius4

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

Copy link
Copy Markdown
Collaborator

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 requested a review from dgp1130 January 31, 2022 15:04
@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
Copy Markdown

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