Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.

Commit bb3ffca

Browse files
committed
fix: transpile vuetify if not already defined in vue.config.js
automated support for edge/ie11
1 parent afb65c2 commit bb3ffca

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
const path = require('path')
2+
3+
function resolve (dir) {
4+
return path.join(__dirname, '..', dir)
5+
}
6+
17
module.exports = (api) => {
28
const hasVuetifyLoader = Boolean(
39
api.service.pkg.devDependencies['vuetify-loader'] ||
@@ -7,6 +13,19 @@ module.exports = (api) => {
713
if (hasVuetifyLoader) {
814
const VuetifyLoaderPlugin = require('vuetify-loader/lib/plugin')
915

16+
// As the vuetify-loader automatically imports the necessary Vuetify components they are not found and
17+
// transpiled by Babel. Add Vuetify explicitly as a module to be transpiled.
18+
if (opts.transpileDependencies.indexOf('vuetify') === -1) {
19+
api.chainWebpack(config => {
20+
config.module
21+
.rule('js')
22+
.test(/\.m?jsx?$/)
23+
.include
24+
.add(resolve('vuetify'))
25+
.end()
26+
})
27+
}
28+
1029
api.chainWebpack(config => {
1130
config.plugin('VuetifyLoaderPlugin')
1231
.use(VuetifyLoaderPlugin)

0 commit comments

Comments
 (0)