Skip to content

Commit 0e183ad

Browse files
committed
Update rollup configuration
1 parent fcc45e1 commit 0e183ad

File tree

5 files changed

+11
-8
lines changed

5 files changed

+11
-8
lines changed

.pnp.cjs

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.yarn/install-state.gz

78 Bytes
Binary file not shown.

package.json

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,12 @@
2525
},
2626
"packageManager": "[email protected]",
2727
"devDependencies": {
28+
"@esbuild-plugins/node-globals-polyfill": "^0.1.1",
29+
"@esbuild-plugins/node-modules-polyfill": "^0.1.4",
2830
"esbuild": "^0.15.5",
31+
"rollup-plugin-node-polyfills": "^0.2.1",
2932
"typescript": "^4.7.4",
3033
"vite": "^3.0.9",
3134
"vite-plugin-inspect": "^0.6.0"
32-
},
33-
"dependencies": {
34-
"@esbuild-plugins/node-globals-polyfill": "^0.1.1",
35-
"@esbuild-plugins/node-modules-polyfill": "^0.1.4"
3635
}
3736
}

src/index.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
2-
import rollupNodePolyFill, { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill'
2+
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill'
3+
import rollupNodePolyFill from 'rollup-plugin-node-polyfills'
34
import type { Plugin } from 'vite'
45

56
export const nodePolyfills = (_options = {}): Plugin => {
@@ -10,7 +11,7 @@ export const nodePolyfills = (_options = {}): Plugin => {
1011
build: {
1112
rollupOptions: {
1213
plugins: [
13-
rollupNodePolyFill(),
14+
rollupNodePolyFill,
1415
],
1516
},
1617
},
@@ -21,10 +22,10 @@ export const nodePolyfills = (_options = {}): Plugin => {
2122
},
2223
plugins: [
2324
NodeGlobalsPolyfillPlugin({
25+
buffer: true,
2426
process: true,
25-
buffer: true
2627
}),
27-
NodeModulesPolyfillPlugin()
28+
NodeModulesPolyfillPlugin(),
2829
]
2930
},
3031
},

yarn.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1612,6 +1612,7 @@ __metadata:
16121612
"@esbuild-plugins/node-globals-polyfill": ^0.1.1
16131613
"@esbuild-plugins/node-modules-polyfill": ^0.1.4
16141614
esbuild: ^0.15.5
1615+
rollup-plugin-node-polyfills: ^0.2.1
16151616
typescript: ^4.7.4
16161617
vite: ^3.0.9
16171618
vite-plugin-inspect: ^0.6.0

0 commit comments

Comments
 (0)