-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
standalone.js: not ES5 compatible anymore since 1.15.0 -> Unexpected token: keyword (const) #5461
Copy link
Copy link
Closed
Closed
Copy link
Labels
area:standaloneIssues with Prettier's Standalone build (meant to be used in the browser)Issues with Prettier's Standalone build (meant to be used in the browser)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!Issues with an accompanying pull request. These issues will probably be fixed soon!type:infraIssues about CI, publishing to npm, or similarIssues about CI, publishing to npm, or similar
Milestone
Metadata
Metadata
Assignees
Labels
area:standaloneIssues with Prettier's Standalone build (meant to be used in the browser)Issues with Prettier's Standalone build (meant to be used in the browser)locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.status:has prIssues with an accompanying pull request. These issues will probably be fixed soon!Issues with an accompanying pull request. These issues will probably be fixed soon!type:infraIssues about CI, publishing to npm, or similarIssues about CI, publishing to npm, or similar
Environments:
Steps to reproduce:
Build your application with Webpack and UglifyJS targeting ES5.
Expected behavior:
The applications should build correctly with ES5 without using any parser to compile external libraries (i.e. Prettier).
Actual behavior:
The build fails due to:
The issue was introduced in this commit: 9120689#diff-863f7f2568e0a7b62f866fcadb68d31e as part of this PR #5040 for Prettier 1.15.x.
Basically, this destructuring assignment:
is not correctly parsed to ES5 when building/releasing the Prettier package. In the distribution package the
standalone.jsfile is like this: