APIDevTools / swagger-parser

Swagger 2.0 and OpenAPI 3.0 parser/validator
https://apitools.dev/swagger-parser
MIT License
1.08k stars 153 forks source link

[HELP] - Please help me add this package on Vite #223

Closed sujit-baniya closed 2 years ago

sujit-baniya commented 2 years ago

I'm trying to parse swagger.json file. For the purpose, I've been trying to setup this package with Vite but getting error.

node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/esm/types.js:1:9: ERROR: No matching export in "browser-external:util" for import "inspect"

I tried to add following code in vite.config.ts but still didn't help

import { nodeResolve } from '@rollup/plugin-node-resolve';
export default defineConfig({
    base: '',
    resolve: {
        alias: {
            '~/': `${path.resolve(__dirname, 'src')}/`,
        },
    },
    plugins: [
        nodeResolve({
            browser: true
        }),
        ]
})

Please help me fix the issue.

baileynottingham commented 2 years ago

@sujit-baniya I'm also having difficulty adding this package on Vite. Since you marked this as completed, would you mind sharing your vite.config file that got it working for you?

sujit-baniya commented 2 years ago

@baileynottingham here's the config file I'm using https://gist.github.com/sujit-baniya/759104dbbd9fa76d20a042108bad0f78

Also I've made changes in the package and I've shared with you on linkedin