vercel / next.js

The React Framework
https://nextjs.org
MIT License
121.8k stars 26.05k forks source link

feat: support import attributes #65749

Closed ForsakenHarmony closed 2 weeks ago

ForsakenHarmony commented 2 weeks ago

Unreverting #59480 Disabled the tests for turbopack, they are enabled in the follow-up: #59370

What?

Add support to import attributes.

Why?

The old import assertions syntax is deprecated, and the proposal is updated. See https://github.com/babel/babel/pull/15536

How?

Add support to import attributes and keep old import assertions working by using @babel/plugin-syntax-import-attributes with the deprecatedAssertSyntax option.

Docs: https://babeljs.io/docs/babel-plugin-syntax-import-attributes

ijjk commented 2 weeks ago

Tests Passed