By default, you will get all the third-party plugins that we are using will be included in package. Now, you can add your custom third-party plugin or remove unwanted plugins to reduce bundle size and compile time.
To add a third-party plugin to your project, follow these steps :
libs
directory to include the plugin's CSS and JS filesFor example, if you want to include bootstrap-select plugin, you need to follow this:
npm i bootstrap-select
.bootstrap-select
directory within the libs
directory & create plugin
related files like :
bootstrap-select.js
&
bootstrap-select.scss
bootstrap-select.scss
file. Refer to the template support for more details.import 'bootstrap-select/js/bootstrap-select';
@import "../../scss/_bootstrap-extended/include";
@import "bootstrap-select/sass/bootstrap-select";
// include scss that you want to overwrite
/* Light Theme */
[data-bs-theme="light"] {
.bootstrap-select {
...
}
}
/* Dark Theme */
@if $enable-dark-mode {
@include color-mode(dark) {
.bootstrap-select {
...
}
}
}
/* LTR Style */
:dir(ltr) {
.bootstrap-select {
...
}
}
/* RTL Style */
:dir(rtl) {
.bootstrap-select {
...
}
}
// Include stylesheet
<link rel="stylesheet" href="vendor/libs/bootstrap-select/bootstrap-select.css" />
// Include Javascript
<script src="vendor/libs/bootstrap-select/bootstrap-select.js"></script>
// Include page specific Javascript
<script src="js/page.js"></script>
// Include HTML
<select class="selectpicker w-100" data-style="btn-default">
<option>Rocky</option>
<option>Pulp Fiction</option>
<option>The Godfather</option>
</select>
// To style only selects with the selectpicker class
$('.selectpicker').selectpicker();
For example, if you want to include bootstrap-select
plugin, you need to follow this:
bootstrap-select
plugin's CSS & JS filebootstrap-select.js
& bootstrap-select.css
files inside a folder For
example, bootstrap-select at /assets/vendors/libs/
.
Check plugin options and configurations that you want to use and You're done!
You can remove unwanted third-party plugins to reduce bundle size and execution time :
npm uninstall <module_name> --save
to remove module from dependencies in
package.json
package.json
file.
libs
directory.@imports
and @includes
.For example, if you want to remove bootstrap-select plugin, you need to follow this:
npm uninstall bootstrap-select --save
.package.json
file.libs/bootstrap-select
directory.@import "../../libs/bootstrap-select/mixins";
assets/vendors/libs
directory.For example, if you want to remove bootstrap-select plugin, you need to follow this:
assets/vendors/libs
directory.