Skip to content

Function: stringifyModuleId() ​

  • Exported from: rolldown/utils
  • Type: (rawId: string, attributes?: Record<string, string>) => string

Builds the module id of rawId imported with attributes. Without attributes it is rawId itself.

Parameters ​

rawId ​

string

attributes? ​

Record<string, string>

Returns ​

string

Example ​

js
stringifyModuleId('/src/a.json', { type: 'json' });
// → '/src/a.json?attributes=%7B%22type%22%3A%22json%22%7D'

Was this page helpful?