Topic: Import JS Modules
riomigal free asked 4 years ago
Hello,
I am using module imports, but it imports the whole library.
E.g. if I want to import
import { Modal } from 'mdb-ui-kit';
Webpack compiles the whole library in prod mode: (Laravel 8 Project)
/css/app.css 124 KiB 0 [emitted] /js/app
/js/app.js 1.08 MiB 0 [emitted] [big] /js/app
Could you please help?
Thank you
Grzegorz Bujański staff answered 4 years ago
Hi. If you only need a few of our components, you should import them from the src
folder. For a modal it will be:
import { Modal } from 'mdb-ui-kit/src/js/free/modal';
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB Standard
- MDB Version: 2.0.0
- Device: Notebook
- Browser: Chrome
- OS: Windows
- Provided sample code: No
- Provided link: No
riomigal free commented 4 years ago
Anyone an idea?