enable fs in node polyfill
This commit is contained in:
parent
b391f21d5f
commit
99cf8ff92d
1 changed files with 4 additions and 3 deletions
|
@ -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({
|
||||||
|
@ -91,7 +92,7 @@ export default defineConfig({
|
||||||
}),
|
}),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
outDir: 'dist',
|
outDir: 'dist',
|
||||||
sourcemap: true,
|
sourcemap: true,
|
||||||
|
@ -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 }),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue