-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
Description
Rollup Version
4.32.0
Operating System (or Browser)
MacOS
Node Version (if applicable)
v22.13.1
Link To Reproduction
Expected Behaviour
I would expect the dynamic import line to also be changed to use with instead of assert so the output looks like
import '/test/index.json' with { type: 'json' };
// TREE-SHAKING
const test = async (val) => {
{
await import('/test/index.json', { with: { type: 'json' } });
}
};
console.log(test()); // 125
when output.importAttributesKey = 'with'
Actual Behaviour
Instead, the dynamic import is hardcoded with assert and can not be changed via the config option
import '/test/index.json' with { type: 'json' };
// TREE-SHAKING
const test = async (val) => {
{
await import('/test/index.json', { assert: { type: 'json' } });
}
};
console.log(test()); // 125
Due to (I believe)
rollup/src/ast/nodes/ImportExpression.ts
Line 218 in 2538304
| `,${_}${getObject([['assert', this.attributes]], { |
Reactions are currently unavailable