enable fs in node polyfill

This commit is contained in:
Ajay Bura 2023-01-29 12:02:26 +05:30
parent b391f21d5f
commit 99cf8ff92d

View file

@ -28,6 +28,7 @@ const copyFiles = {
} }
const nodePolyfillAliases = { const nodePolyfillAliases = {
// https://github.com/ionic-team/rollup-plugin-node-polyfills/tree/master/polyfills
util: 'rollup-plugin-node-polyfills/polyfills/util', util: 'rollup-plugin-node-polyfills/polyfills/util',
// sys: 'util', // sys: 'util',
// events: 'rollup-plugin-node-polyfills/polyfills/events', // events: 'rollup-plugin-node-polyfills/polyfills/events',
@ -59,7 +60,7 @@ const nodePolyfillAliases = {
// tty: 'rollup-plugin-node-polyfills/polyfills/tty', // tty: 'rollup-plugin-node-polyfills/polyfills/tty',
// domain: 'rollup-plugin-node-polyfills/polyfills/domain', // domain: 'rollup-plugin-node-polyfills/polyfills/domain',
buffer: 'rollup-plugin-node-polyfills/polyfills/buffer-es6', buffer: 'rollup-plugin-node-polyfills/polyfills/buffer-es6',
process: 'rollup-plugin-node-polyfills/polyfills/process-es6' // process: 'rollup-plugin-node-polyfills/polyfills/process-es6',
} }
export default defineConfig({ export default defineConfig({
@ -100,7 +101,7 @@ export default defineConfig({
plugins: [ plugins: [
// Enable rollup polyfills plugin // Enable rollup polyfills plugin
// used during production bundling // used during production bundling
rollupNodePolyFill({ crypto: true }), rollupNodePolyFill({ crypto: true, fs: true }),
] ]
} }
}, },