Skip to content

Commit

Permalink
fix: transpile 'vuetify' instead of 'vuetify/lib'
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmarrec committed Jan 17, 2020
1 parent f6bed38 commit 059ca8c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export default function setupPlugin (this: ModuleThis, options: Options) {
const transpile = this.options.build!.transpile!

if (Array.isArray(transpile)) {
transpile.push('vuetify/lib')
transpile.push('vuetify')
} else {
this.options.build!.transpile = ctx => [...transpile(ctx), 'vuetify/lib']
this.options.build!.transpile = ctx => [...transpile(ctx), 'vuetify']
}

const optionsPath = typeof options.frameworkOptions === 'string' && this.nuxt.resolver.resolveAlias(options.frameworkOptions)
Expand Down
2 changes: 1 addition & 1 deletion test/fixture/vuetify.options.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { VuetifyPreset } from 'vuetify/types/services/presets'
import colors from 'vuetify/es5/util/colors'
import colors from 'vuetify/lib/util/colors'

const options: VuetifyPreset = {
theme: {
Expand Down
4 changes: 2 additions & 2 deletions test/module.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ describe('setupPlugin', () => {
return typeof transpile === 'function' ? transpile() : transpile
}

expect(testTranspile(['foo'])).toEqual(['foo', 'vuetify/lib'])
expect(testTranspile(() => ['foo'])).toEqual(['foo', 'vuetify/lib'])
expect(testTranspile(['foo'])).toEqual(['foo', 'vuetify'])
expect(testTranspile(() => ['foo'])).toEqual(['foo', 'vuetify'])
})

test('frameworkOptions', () => {
Expand Down

0 comments on commit 059ca8c

Please sign in to comment.