Skip to content

Commit 4add89c

Browse files
committed
docs: add instructions for using with next.js
1 parent 3441944 commit 4add89c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,22 @@ export default defineConfig({
126126
})
127127
```
128128

129+
### Next.js
130+
131+
For Next, you will need to ensure you are using `next.config.mjs` or have set `"type": "module"` in your `package.json.
132+
133+
```js
134+
import { MagicRegExpTransformPlugin } from 'magic-regexp/transform'
135+
136+
export default {
137+
webpack(config) {
138+
config.plugins = config.plugins || []
139+
config.plugins.push(MagicRegExpTransformPlugin.webpack())
140+
return config
141+
},
142+
}
143+
```
144+
129145
### unbuild
130146

131147
```js

0 commit comments

Comments
 (0)