Open wilcoschoneveld opened 4 years ago
I have the same issue
I did resolve those and its specific to rollup used by Svelte with Typescript
I added import nodePolyfills from 'rollup-plugin-polyfill-node';
followed by
plugins: [
nodePolyfills([
'url',
'util',
'http',
'https'
]),
from there I ran into a complaint with require('child_process')
in writeBundle()
. To fix that I added an import for child_process and then change the reference to use the imported type
import child_process from 'child_process';
...
server = child_process.spawn('npm', ['run', 'start', '--', '--dev'], {
Consequently, no good deed goes unpunished and now if I try to leverage the following, I get a complaint about Zschema using require and I'm back at square one
import SwaggerParser from "@apidevtools/swagger-parser";
...
onMount(() => {
SwaggerParser.parse(myAwesomeUri).then( (document: OpenApi.Document ) => {...});
});
Hey guys!
How would I go about adding this package to a svelte rollup project?
I'm working from this template: https://github.com/sveltejs/template
Even when I add
@rollup/plugin-json
I can't seem to get it to work, rollup is complaining about missingutil
package..It looks like the
browser:true
is ignored in the resolve plugin?A quick explanation of steps needed to get it to work in the template would be awesome!
Thanks a lot for the help!