Merge pull request #4 from Instadapp/nuxt-upgrade

This commit is contained in:
Georges KABBOUCHI 2022-11-23 21:26:12 +02:00 committed by GitHub
commit 339338cfc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1554 additions and 2111 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@instadapp/vue-web3-nuxt", "name": "@instadapp/vue-web3-nuxt",
"version": "0.9.7", "version": "0.9.8",
"license": "MIT", "license": "MIT",
"type": "module", "type": "module",
"exports": { "exports": {
@ -23,20 +23,20 @@
"dependencies": { "dependencies": {
"@esbuild-plugins/node-globals-polyfill": "^0.1.1", "@esbuild-plugins/node-globals-polyfill": "^0.1.1",
"@esbuild-plugins/node-modules-polyfill": "^0.1.4", "@esbuild-plugins/node-modules-polyfill": "^0.1.4",
"@instadapp/vue-web3": "latest", "@instadapp/vue-web3": "^0.9.7",
"@nuxt/kit": "^3.0.0-rc.11", "@nuxt/kit": "^3.0.0",
"events": "^3.3.0", "events": "^3.3.0",
"mkdirp-promise": "4", "mkdirp-promise": "4",
"rollup-plugin-node-polyfills": "^0.2.1" "rollup-plugin-node-polyfills": "^0.2.1"
}, },
"devDependencies": { "devDependencies": {
"@nuxt/module-builder": "latest", "@nuxt/module-builder": "^0.2.1",
"@nuxt/ui": "^0.3.3", "@nuxt/ui": "^0.3.3",
"@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.24.0",
"nuxt": "^3.0.0-rc.11" "nuxt": "^3.0.0"
} }
} }

View File

@ -1,9 +1,4 @@
import { import { addImports, defineNuxtModule, extendViteConfig } from '@nuxt/kit'
addAutoImport,
addImportsDir,
defineNuxtModule,
extendViteConfig,
} from '@nuxt/kit'
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill' import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
import rollupNodePolyFill from 'rollup-plugin-node-polyfills' import rollupNodePolyFill from 'rollup-plugin-node-polyfills'
@ -20,21 +15,12 @@ export default defineNuxtModule<ModuleOptions>({
autoImport: true, autoImport: true,
}, },
setup(options, nuxt) { setup(options, nuxt) {
// nuxt.hook('vite:extendConfig', (clientConfig, { isClient }) => {
// if (isClient && process.env.NODE_ENV === 'production') {
// clientConfig.resolve.alias = {
// ...clientConfig.resolve.alias,
// web3: resolve('./node_modules/web3/dist/web3.min.js')
// }
// }
// })
extendViteConfig((config) => { extendViteConfig((config) => {
config.build = config.build || {} config.build = config.build || {}
config.build.rollupOptions = config.build.rollupOptions || {} config.build.rollupOptions = config.build.rollupOptions || {}
config.build.rollupOptions.plugins = config.build.rollupOptions.plugins =
config.build.rollupOptions.plugins || [] config.build.rollupOptions.plugins || []
config.build.rollupOptions.plugins.push(rollupNodePolyFill()) config.build.rollupOptions.plugins.push(rollupNodePolyFill() as any)
config.optimizeDeps = config.optimizeDeps || {} config.optimizeDeps = config.optimizeDeps || {}
config.optimizeDeps.esbuildOptions = config.optimizeDeps.esbuildOptions =
@ -54,7 +40,7 @@ export default defineNuxtModule<ModuleOptions>({
}) })
if (options.autoImport) { if (options.autoImport) {
addAutoImport({ addImports({
name: 'useWeb3', name: 'useWeb3',
from: '@instadapp/vue-web3', from: '@instadapp/vue-web3',
}) })

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{ {
"name": "@instadapp/vue-web3", "name": "@instadapp/vue-web3",
"version": "0.9.7", "version": "0.9.8",
"description": "Vue web3 composition api", "description": "Vue web3 composition api",
"license": "MIT", "license": "MIT",
"main": "index.js", "main": "index.js",