DEV Community

Discussion on: Import dependencies with Svelte and Rollup?

Collapse
 
richharris profile image
Rich Harris

If you're using the starter template, you should already have rollup-plugin-node-resolve and rollup-plugin-commonjs plugins installed, it should Just Work. Indeed, adding

import buildUrl from 'build-url';
Enter fullscreen mode Exit fullscreen mode

to a component in a fresh project works exactly as you'd expect. Are you getting any error messages? Have you done npm install build-url?

For future reference, questions like these are better asked over on Stack Overflow using the svelte tag, or in svelte.dev/chat, than on dev.to which is more for blog posts etc than support requests.