Skip to content

Commit efe0fa3

Browse files
committed
fix!: interop default for cjs
1 parent b26ad9d commit efe0fa3

File tree

6 files changed

+134
-12
lines changed

6 files changed

+134
-12
lines changed

src/esbuild.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1-
import unplugin from '.'
1+
/**
2+
* This entry file is for esbuild plugin. Requires esbuild >= 0.15
3+
*
4+
* @module
5+
*/
26

3-
export default unplugin.esbuild as typeof unplugin.esbuild
7+
import unplugin from './index'
8+
9+
/**
10+
* Esbuild plugin
11+
*
12+
* @example
13+
* ```ts
14+
* // esbuild.config.js
15+
* import { build } from 'esbuild'
16+
*
17+
* build({
18+
* plugins: [require('unplugin-raw/esbuild')()],
19+
* })
20+
* ```
21+
*/
22+
const esbuild = unplugin.esbuild as typeof unplugin.esbuild
23+
export default esbuild
24+
export { esbuild as 'module.exports' }

src/rolldown.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1-
import unplugin from '.'
1+
/**
2+
* This entry file is for Rolldown plugin.
3+
*
4+
* @module
5+
*/
26

3-
export default unplugin.rolldown as typeof unplugin.rolldown
7+
import unplugin from './index'
8+
9+
/**
10+
* Rolldown plugin
11+
*
12+
* @example
13+
* ```ts
14+
* // rolldown.config.js
15+
* import Raw from 'unplugin-raw/rolldown'
16+
*
17+
* export default {
18+
* plugins: [Raw()],
19+
* }
20+
* ```
21+
*/
22+
const rolldown = unplugin.rolldown as typeof unplugin.rolldown
23+
export default rolldown
24+
export { rolldown as 'module.exports' }

src/rollup.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1-
import unplugin from '.'
1+
/**
2+
* This entry file is for Rollup plugin.
3+
*
4+
* @module
5+
*/
26

3-
export default unplugin.rollup as typeof unplugin.rollup
7+
import unplugin from './index'
8+
9+
/**
10+
* Rollup plugin
11+
*
12+
* @example
13+
* ```ts
14+
* // rollup.config.js
15+
* import Raw from 'unplugin-raw/rollup'
16+
*
17+
* export default {
18+
* plugins: [Raw()],
19+
* }
20+
* ```
21+
*/
22+
const rollup = unplugin.rollup as typeof unplugin.rollup
23+
export default rollup
24+
export { rollup as 'module.exports' }

src/rspack.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1-
import unplugin from '.'
1+
/**
2+
* This entry file is for rspack plugin.
3+
*
4+
* @module
5+
*/
26

3-
export default unplugin.rspack as typeof unplugin.rspack
7+
import unplugin from './index'
8+
9+
/**
10+
* Rspack plugin
11+
*
12+
* @example
13+
* ```ts
14+
* // rspack.config.js
15+
* module.exports = {
16+
* plugins: [require('unplugin-raw/rspack')()],
17+
* }
18+
* ```
19+
*/
20+
const rspack = unplugin.rspack as typeof unplugin.rspack
21+
export default rspack
22+
export { rspack as 'module.exports' }

src/vite.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1-
import unplugin from '.'
1+
/**
2+
* This entry file is for Vite plugin.
3+
*
4+
* @module
5+
*/
26

3-
export default unplugin.vite as typeof unplugin.vite
7+
import unplugin from './index'
8+
9+
/**
10+
* Vite plugin
11+
*
12+
* @example
13+
* ```ts
14+
* // vite.config.ts
15+
* import Raw from 'unplugin-raw/vite'
16+
*
17+
* export default defineConfig({
18+
* plugins: [Raw()],
19+
* })
20+
* ```
21+
*/
22+
const vite = unplugin.vite as typeof unplugin.vite
23+
export default vite
24+
export { vite as 'module.exports' }

src/webpack.ts

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1-
import unplugin from '.'
1+
/**
2+
* This entry file is for webpack plugin.
3+
*
4+
* @module
5+
*/
26

3-
export default unplugin.webpack as typeof unplugin.webpack
7+
import unplugin from './index'
8+
9+
/**
10+
* Webpack plugin
11+
*
12+
* @example
13+
* ```ts
14+
* // webpack.config.js
15+
* module.exports = {
16+
* plugins: [require('unplugin-raw/webpack')()],
17+
* }
18+
* ```
19+
*/
20+
const webpack = unplugin.webpack as typeof unplugin.webpack
21+
export default webpack
22+
export { webpack as 'module.exports' }

0 commit comments

Comments
 (0)