Skip to content

Commit 175be26

Browse files
tmorehouseGregYankovoy
authored andcommitted
Enhancement: Adding mutationobserver-shim & assorted devDependencies
- Moving to official BootstrapVue logo
1 parent 6eae1e2 commit 175be26

File tree

4 files changed

+51
-3
lines changed

4 files changed

+51
-3
lines changed

generator/index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@ module.exports = (api, opts, rootOpts) => {
44
api.extendPackage({
55
dependencies: {
66
'bootstrap-vue': '^2.0.0-rc.19'
7+
},
8+
devDependencies: {
9+
'bootstrap': '^4.3.1',
10+
'popper.js': '^1.15.0',
11+
'portal-vue': '^2.1.4',
12+
'sass-loader': '^7.1.0',
13+
'node-sass': '^4.12.0'
714
}
815
})
916

1017
if (opts.usePolyfill) {
1118
api.extendPackage({
1219
devDependencies: {
1320
'@babel/polyfill': '^7.4.4',
21+
'mutationobserver-shim': '^0.3.3'
1422
}
1523
})
1624
}
@@ -56,10 +64,12 @@ module.exports = (api, opts, rootOpts) => {
5664
})
5765

5866
helpers.updateMain(src => {
59-
if (!src.find(l => l.match(/^(import|require).*@babel\/polyfill.*$/))) {
67+
if (!src.find(l => l.match(/^(import|require).+mutationobserver-shim.*$/))) {
68+
src.unshift('import \'mutationobserver-shim\'')
69+
}
70+
if (!src.find(l => l.match(/^(import|require).+@babel\/polyfill.*$/))) {
6071
src.unshift('import \'@babel/polyfill\'')
6172
}
62-
6373
return src
6474
})
6575
}

index.js

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,31 @@
1-
module.exports = (api, opts) => {}
1+
module.exports = (api, opts) => {
2+
// Resolve asset references from components
3+
api.chainWebpack(config => {
4+
config.module
5+
.rule('vue')
6+
.use('vue-loader')
7+
.tap(options => {
8+
const transformAssetUrls = options.transformAssetUrls || {}
9+
return {
10+
...options,
11+
transformAssetUrls: {
12+
// Ensure defaults exist
13+
video: ['src', 'poster'],
14+
source: 'src',
15+
img: 'src',
16+
image: 'xlink:href',
17+
// Add any other pre defined custom asset items
18+
...transformAssetUrls,
19+
// Add BootstrapVue specific component asset items
20+
'b-img': 'src',
21+
'b-img-lazy': ['src', 'blank-src'],
22+
'b-card': 'img-src',
23+
'b-card-img': 'img-src',
24+
'b-card-img-lazy': ['src', 'blank-src'],
25+
'b-carousel-slide': 'img-src',
26+
'b-embed': 'src'
27+
}
28+
}
29+
})
30+
})
31+
}

logo.png

842 Bytes
Loading

package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,17 @@
1111
"url": "git+https://github.com/GregYankovoy/vue-cli-plugin-bootstrap-vue.git"
1212
},
1313
"keywords": [
14+
"bootstrap-vue",
15+
"bootstrap vue",
16+
"BootstrapVue",
17+
"vue bootstrap",
1418
"bootstrap",
19+
"bootstrap v4",
20+
"bootstrap 4",
1521
"plugin",
1622
"vue",
23+
"vue-cli",
24+
"vue-cli-3",
1725
"cli",
1826
"3"
1927
],

0 commit comments

Comments
 (0)