Home
About
moon indicating dark mode
sun indicating light mode

Configure Rollup to bundle Axios module

May 25, 2021


  1. npm install rollup-plugin-node-resolve rollup-plugin-json.

  2. Add it to the plugins inside rollup.config.js

// Rollup configuration
...
plugins: [
rollupNodeResolve({
jsnext: true,
preferBuiltins: true,
browser: true
}),
rollupJson(),
...
]

Notice the browser: true

  1. Run your build again: yarn run build

Voila!

Source

Edit on githubTweet

With 💗 by Aleem Isiaka.
Software Engineer >>> Computer && Machines | Learner && Writer