﻿<head><script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-4357510538660394"
     crossorigin="anonymous"></script></head>---
url: /reference/Function.parseModuleId.md
---
# Function: parseModuleId()

* **Exported from**: `rolldown/utils`
* **Type**: (`id`: `string`) => { `attributes`: `Record`<`string`, `string`>; `rawId`: `string`; }

Splits a module id into the raw id and the import attributes it was built from.

Only an id in the exact format that Rolldown uses is split. Any other id, e.g.
`virtual?attributes=foo`, is returned as the raw id with no attributes. See
[Module ids](/in-depth/import-attributes#module-ids) for the format.

## Parameters

### id

`string`

## Returns

{ `attributes`: `Record`<`string`, `string`>; `rawId`: `string`; }

### attributes

* **Type**: `Record`<`string`, `string`>

### rawId

* **Type**: `string`

## Example

```js
parseModuleId('/src/a.json?attributes=%7B%22type%2