How to handle svg imports (ES6) in rollup

If I'm importing an svg file into an ES6 module, how do I handle that in rollup? I currently have something like this (simple example of what I'm doing): import next from...

Flow rollup, react and babel TypeError: Super expression must either be null or a function, not undefined

I'm trying to use flow, babel and rollup, but my code breaks when adding flow. I have tried the rollup-plugin-flow and the different babel-..-.. flow plugins (current implementation), but I'm...

How to bundle react app with rollup

I am looking for help with rollup config to build simplest react app. Currently my bundled js file doesn't really bundle any dependency and looks pretty bare bone. Repo to repro rollup config...

Rollup + React not compiling JSX

I'm trying to use Rollup + React but I'm encounting an error when rollup encounters JSX. Unexpected token... export default () => <p>M... I have a repo that triggers the error. All...

How to resolve rollup build error when using emotion: 'default' is not exported by @emotion\memoize\dist\memoize.cjs.js

I'm trying to build a standardized react button component for our enterprise library. I want to be able to use @emotion/styled to generate the styled react component. We are using rollup as our...

svelte/sapper direct link problems on zeit/now - how to debug or fix?

In dev, I can direct link to any route. On Zeit/now, I can lead links to some pages but not others. I'm struggling to determine the problem. Here's an example, navigating straight to...

Google captcha with svelte

So I had an issue with svelte and google Recaptcha API. My main HTML file <!DOCTYPE html> <html lang="en"> <head> <meta charset='utf-8'> <meta name='viewport'...

How to remove circular dependencies in d3 selection using rollupjs?

Actually I am trying to bundle my d3 project using Rollupjs but when I used ./node_modules/.bin/rollup -c in terminal an error appeared i.e. src/scripts/index.js → sample/bundle.js... (!)...

How to import and bundle lodash using rollup?

I am unable to import lodash with rollup. I have tried some different configuration but haven't found anything that works. Using lodash import compose from...

Importing from subfolders for a javascript package

I have a typescript library consists of multiple folders. Each folder contains an index.ts file which exports some business logic. I am trying to bundle this with rollup to achieve this behavior...

Rollup is not generating typescript sourcemap

I am using rollup with svelte + typescript + scss. My problem is that I am not able to generate source maps. Following is my rollup config file: import svelte from 'rollup-plugin-svelte' import...

Svelte (rollup) - Error: Unexpected token (Note that you need @rollup/plugin-json to import JSON files)

I am doing nothing to trigger this error. The app works fine one second, and doesn't the next. Why is this happening? It is not due to the missing @rollup/plugin-json plugin because it worked...

svelte - `npm run build` will get the "unexpected token <" error

After done with my development, I run npm run build to build the production app. but I will get: Uncaught SyntaxError: Unexpected token '<' from bundle.js. I am running on svelte 3.0.0. How can...

got Can't resolve 'react/jsx-runtime' error while use try to create the shared component with storybook in react-typescript

I tried to create a shared component using a storybook with react-redux. I am using rollup to create a shared component. due to some error unable to create the shared component. package.json { ...

How to add Sapper to existing Svelte project?

I have extensive applications in svelte, later I need to attach a sapper to it for further work, it is possibly? I try do it via: npm i @sapper but when I try to import something from this...

Uncaught Error: Cannot find module 'react/jsx-runtime'

I am exploring making a component library using React and rollup, but finding that the app that is consuming the library is bundling it in the wrong order. This is causing the below...

How do I import crypto in Svelte?

I created a basic svelte project (it uses rollup). I want to import a native library, crypto into the project like so. // src/lib/encrypt.js import { randomBytes } from "crypto"; const encrypt =...

Error: You must use the `@babel/plugin-transform-runtime` plugin when `babelHelpers` is "runtime" on npm link

I have 2 react libraries, and one consumes the other. project-ui propert-utils project-utils is installed in project-ui "devDependencies": { "@company/project-utils":...

how to configure rollup vue3 environment

when I use rollup configure vue3 environment ,i run it then use the component in the html file,it happen error the code below rollup.config.js this is rollup config file const path =...

Rollup + React 17 with new JSX Transform - "React is not defined"

I'm trying to prototype a microfrontend architecture with Rollup and a couple of create-react-app applications. However when I locally yarn link my external app with the container app, I run into...

ESM library generated with rollup-plugin-postcss throws Cannot find module '../node_modules/style-inject/dist/style-inject.es.js'

We are maintaining an internal library which is exporting ESM modules using Rollup. We have just recently switched to using CSS modules, which we have set with rollup-plugin-postcss. We want to...

React Rollup build with styled-components namespace issue

I created an "UI Lib" to use in other projects with ReactJS + TS + styled-components and Rollup and I'm facing some problems with conflicted classNames. I know that styled-components provides a...

Typescript definitions in wrong folder using rollup and typescript2

I'm building a package using React, Typescript, Rollup, rollup-plugin-typescript2. While the generated JS files are fine, the generated definition files are in the wrong directory. Current...

Svelte Swiper is causing unexpected @ in /swiper/swiper.scss

So, I am building a site using svelte and I am using swiper for one of the functionalities but I get this error that states [!] Error: Unexpected character '@' (Note that you need plugins to...

Configuring Jest with Rollup and Typescript

I created an app within a monorepo (Lerna) using yarn workspace. The architecture of the app is as follow: my-monorepo ├── node_modules ├── packages │   ├── package1(shared...

How do I bundle MUI theme with rollup

I've been working on pulling our existing react FE components out of our main repo, and into a separate repo that I am bundling with rollup. Our old code was using makeStyles and I have been...

Issues publishing Vue 3 component "library" with Vite

I'm encountering the following issue when publishing a Vue 3 component library (written in TypeScript) to npm, using Vite: TS2305: Module '"@observerly/celestia-vue"' has no exported member...

Error: Unexpected token (Note that you need plugins to import files that are not JavaScript) rollup vue package

I wanna try to rollup a vue component library. But I got the error on my type checking. I try to update typescript as here has been mentioned but it didn't work. here is my code and...

Svelte - ReferenceError: buffer is not defined

Trying to setup a WebRtc connection in my new Svelte app, and am hitting this error whenever I try to import a library. ReferenceError: buffer is not defined Example Code:...

SvelteKit cannot import Onboard.js

I am working on a SvelteKit project and have installed Onboard.js: I am using the pnpm package manager, but it shouldn't make a difference: pnpm install bnc-onboard // __layout.svelte import...