This commit is contained in:
Georges KABBOUCHI 2023-01-24 20:14:49 +02:00
parent 339338cfc4
commit 0a062c65c3
3 changed files with 1876 additions and 662 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@instadapp/vue-web3-nuxt", "name": "@instadapp/vue-web3-nuxt",
"version": "0.9.8", "version": "0.10.0",
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",
"exports": { "exports": {
@ -21,22 +21,19 @@
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground" "dev:prepare": "nuxt-module-build --stub && nuxi prepare playground"
}, },
"dependencies": { "dependencies": {
"@esbuild-plugins/node-globals-polyfill": "^0.1.1", "@instadapp/vue-web3": "^0.9.8",
"@esbuild-plugins/node-modules-polyfill": "^0.1.4", "@nuxt/kit": "^3.1.0",
"@instadapp/vue-web3": "^0.9.7",
"@nuxt/kit": "^3.0.0",
"events": "^3.3.0",
"mkdirp-promise": "4", "mkdirp-promise": "4",
"rollup-plugin-node-polyfills": "^0.2.1" "vite-plugin-node-polyfills": "^0.7.0"
}, },
"devDependencies": { "devDependencies": {
"@nuxt/module-builder": "^0.2.1", "@nuxt/module-builder": "^0.2.1",
"@nuxt/ui": "^0.3.3", "@nuxt/ui": "^0.4.0",
"@nuxtjs/eslint-config-typescript": "11.0.0", "@nuxtjs/eslint-config-typescript": "11.0.0",
"@web3-react/injected-connector": "^6.0.7", "@web3-react/injected-connector": "^6.0.7",
"@web3-react/network-connector": "^6.2.9", "@web3-react/network-connector": "^6.2.9",
"@web3-react/walletconnect-connector": "^6.2.13", "@web3-react/walletconnect-connector": "^6.2.13",
"eslint": "8.24.0", "eslint": "8.32.0",
"nuxt": "^3.0.0" "nuxt": "^3.1.0"
} }
} }

View File

@ -1,6 +1,5 @@
import { addImports, defineNuxtModule, extendViteConfig } from '@nuxt/kit' import { addImports, addVitePlugin, defineNuxtModule } from '@nuxt/kit'
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill' import { nodePolyfills } from 'vite-plugin-node-polyfills'
import rollupNodePolyFill from 'rollup-plugin-node-polyfills'
export interface ModuleOptions { export interface ModuleOptions {
autoImport: boolean autoImport: boolean
@ -15,29 +14,7 @@ export default defineNuxtModule<ModuleOptions>({
autoImport: true, autoImport: true,
}, },
setup(options, nuxt) { setup(options, nuxt) {
extendViteConfig((config) => { addVitePlugin(nodePolyfills())
config.build = config.build || {}
config.build.rollupOptions = config.build.rollupOptions || {}
config.build.rollupOptions.plugins =
config.build.rollupOptions.plugins || []
config.build.rollupOptions.plugins.push(rollupNodePolyFill() as any)
config.optimizeDeps = config.optimizeDeps || {}
config.optimizeDeps.esbuildOptions =
config.optimizeDeps.esbuildOptions || {}
config.optimizeDeps.esbuildOptions.define =
config.optimizeDeps.esbuildOptions.define || {}
config.optimizeDeps.esbuildOptions.define.global = 'globalThis'
config.optimizeDeps.esbuildOptions.plugins =
config.optimizeDeps.esbuildOptions.plugins || []
config.optimizeDeps.esbuildOptions.plugins.push(
NodeGlobalsPolyfillPlugin({
process: true,
buffer: true,
}),
)
})
if (options.autoImport) { if (options.autoImport) {
addImports({ addImports({

File diff suppressed because it is too large Load Diff