How to disable auto code spliting for Rollup.js bundle?

Viewed 308

I am trying to use Rollup.js v2.40.0 to build a reactjs application.

Rollup.js can make code-spliting automatically if it found the importer is used in multi modules. For example:

//Login.tsx
import Button from '../components/Button';
render <Button />;

//Dashboard.tsx
import Button from '../components/Button';
render <Button />;

//somewhere
const Login = import('../pages/Login');
const Dashboard = import('../pages/Dashboard');

bundule result will be:

//Login.js
var Button = require('./Button-d8dc4a64.js');

//Dashboard.js
var Button = require('./Button-d8dc4a64.js');

//Button-d8dc4a64.js
//....

I don't want to split Button component. I want Login and Dashboard bundle contains Button code. It there a way or an option can disable this feature? I have already checked out the offical document and still can't solve this.

0 Answers
Related