Extending Rollup configuration for NX

const nrwlConfig = require('@nrwl/react/plugins/bundle-rollup')
const svgr = require('@svgr/rollup').default
module.exports = (config) => {
const nxConfig = nrwlConfig(config)
return {
...nxConfig,
plugins: [...nxConfig.plugins, svgr()],
}
}
"rollupConfig": "rollup.config.cjs",
npm i @rollup/plugin-commonjs@14.0.0 --save-dev
const nrwlConfig = require('@nrwl/react/plugins/bundle-rollup')
const svgr = require('@svgr/rollup').default
const commonjs = require('@rollup/plugin-commonjs')
module.exports = (config) => {
const nxConfig = nrwlConfig(config)
return {
...nxConfig,
plugins: [commonjs(), svgr(), ...nxConfig.plugins],
}
}

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Transforming an existing Angular application into a Progressive Web App

Leetcode 5453. Running Sum of 1d Array

React & Flux Tutorials — Create Youtube Player — 3

Angular Universal and why you need it.

Screenshot of the Angular Universal SSR Development Server

いっぱい vs たくさん — What’s the difference?

Trie to Find Words

Tried and Tested Strategies to Optimize your Angular App’s Performance!

Building reason-react with parcel-bundler

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Anton Ball

Anton Ball

More from Medium

The Case Against Unsafe Types and Operators

Counting the frequency of elements in a specific range (Eg: 0–9) in JavaScript

Typescript Generics: Why do we use them?

RxJS — delay vs delayWhen operator