If your bundler supports esm modules, it will automatically prefer it over commonjs.ĭist/ or dist/ĭist/bootstrap-vue-icons.js or dist/ This will allow you to transpile BootstrapVue for your target browsers/environments and potentially reduce bundle sizes (and will only include the babel helper utils once) at the expense of slightly longer build times.Įxample for Babel transpilation:Ĭhoosing the best variant for your build environment / packager helps reduce bundle sizes. You can override the use of the esm/ build by aliasing 'bootstrap-vue' to use the BootstrapVue source files, and whitelisting node_modules/bootstrap-vue/src/* for transpilation by your build process, in your module bundler config. When using module bundlers, they will usually default to using the esm/ modular build, which has been pre-transpiled by Babel for our supported browsers. Using BootstrapVue source code for smaller bundles Vue allows for various component and directive name syntaxes here, so feel free to utilize kebab-casing (shown), camelCasing, PascalCasing, and/or object property shorthand (components only). Note that Vue automatically prefixes directive names with `v-` To cherry pick a component/directive, start by importing it in the file where it is being used: If you would like to only pull in a specific component or set of components, you can do this by directly importing those components. When importing multiple component group and/or directive group plugins, include all imports in a single import statement for optimal tree shaking.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |