-
Notifications
You must be signed in to change notification settings - Fork 12k
feat(@schematics/angular): remove Browserslist configuration files from projects #23897
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
Conversation
This migrations are no longer needed as multiple versions update is not allowed.
1d0ea00
to
819774c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a couple comments.
Typo in the commit message also:
through a migration in exists projects
(exists
--> existing
)
packages/schematics/angular/migrations/migration-collection.json
Outdated
Show resolved
Hide resolved
const defaultSupportedBrowsers = new Set(browserslist(DEFAULT_BROWSERS)); | ||
|
||
for (const path of visit(tree.root)) { | ||
const { defaults: browsersListConfig } = browserslist.parseConfig(tree.readText(path)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there are any other keys for custom sections, we should probably keep the file.
We could optionally cleanup the defaults
section of the file but that might be more complex than needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can at least delete the config if contains the default browsers and old unsupported browsers that generate es5 output.
packages/schematics/angular/migrations/update-15/remove-browserslist-config.ts
Outdated
Show resolved
Hide resolved
…om projects The Browserslist configuration file is redundant as we set the defaults directly in @angular-devkit/build-angular. https://github.com/angular/angular-cli/blob/8da926966e9f414ceecf60b89acd475ce1b55fc5/packages/angular_devkit/build_angular/src/utils/supported-browsers.ts#L12-L19 With this commit, we remove the `.browserlistrc` configuration file from the schematics application template and through a migration in existing projects when the Browserslist query result matches the default. Users needing a finer grain support should still create a `.browserlistrc` in the root directory of the project.
819774c
to
6bbfbfe
Compare
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The Browserslist configuration file is redundant as we set the defaults directly in @angular-devkit/build-angular.
angular-cli/packages/angular_devkit/build_angular/src/utils/supported-browsers.ts
Lines 12 to 19 in 8da9269
With this commit, we remove the
.browserlistrc
configuration file from the schematics application template and through a migration in existing projects when the Browserslist query result matches the default.Users needing a finer grain support should still create a
.browserlistrc
in the root directory of the project.