Skip to content

Commit

Permalink
Merge pull request #4 from Instadapp/nuxt-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
KABBOUCHI authored Nov 23, 2022
2 parents 7605997 + 1e0bc6b commit 339338c
Show file tree
Hide file tree
Showing 4 changed files with 1,606 additions and 2,163 deletions.
10 changes: 5 additions & 5 deletions nuxt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@instadapp/vue-web3-nuxt",
"version": "0.9.7",
"version": "0.9.8",
"license": "MIT",
"type": "module",
"exports": {
Expand All @@ -23,20 +23,20 @@
"dependencies": {
"@esbuild-plugins/node-globals-polyfill": "^0.1.1",
"@esbuild-plugins/node-modules-polyfill": "^0.1.4",
"@instadapp/vue-web3": "latest",
"@nuxt/kit": "^3.0.0-rc.11",
"@instadapp/vue-web3": "^0.9.7",
"@nuxt/kit": "^3.0.0",
"events": "^3.3.0",
"mkdirp-promise": "4",
"rollup-plugin-node-polyfills": "^0.2.1"
},
"devDependencies": {
"@nuxt/module-builder": "latest",
"@nuxt/module-builder": "^0.2.1",
"@nuxt/ui": "^0.3.3",
"@nuxtjs/eslint-config-typescript": "11.0.0",
"@web3-react/injected-connector": "^6.0.7",
"@web3-react/network-connector": "^6.2.9",
"@web3-react/walletconnect-connector": "^6.2.13",
"eslint": "8.24.0",
"nuxt": "^3.0.0-rc.11"
"nuxt": "^3.0.0"
}
}
20 changes: 3 additions & 17 deletions nuxt/src/module.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
addAutoImport,
addImportsDir,
defineNuxtModule,
extendViteConfig,
} from '@nuxt/kit'
import { addImports, defineNuxtModule, extendViteConfig } from '@nuxt/kit'
import { NodeGlobalsPolyfillPlugin } from '@esbuild-plugins/node-globals-polyfill'
import rollupNodePolyFill from 'rollup-plugin-node-polyfills'

Expand All @@ -20,21 +15,12 @@ export default defineNuxtModule<ModuleOptions>({
autoImport: true,
},
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) => {
config.build = config.build || {}
config.build.rollupOptions = config.build.rollupOptions || {}
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.esbuildOptions =
Expand All @@ -54,7 +40,7 @@ export default defineNuxtModule<ModuleOptions>({
})

if (options.autoImport) {
addAutoImport({
addImports({
name: 'useWeb3',
from: '@instadapp/vue-web3',
})
Expand Down
Loading

0 comments on commit 339338c

Please sign in to comment.