diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100755 index 78c4e41c..00000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: 2 -jobs: - build: - docker: - - image: circleci/node - steps: - # Checkout repository - - checkout - - # Restore cache - - restore_cache: - key: yarn-cache-{{ checksum "yarn.lock" }} - - # Install dependencies - - run: - name: Install Dependencies - command: NODE_ENV=dev yarn - - # Keep cache - - save_cache: - key: yarn-cache-{{ checksum "yarn.lock" }} - paths: - - "node_modules" - - # Lint - - run: - name: Lint - command: yarn lint - - # Tests - - run: - name: Tests - command: yarn jest - - # Coverage - - run: - name: Coverage - command: yarn codecov diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..a454d46a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,28 @@ +name: Test + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - uses: actions/cache@v1 + id: cache + with: + path: "node_modules" + key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }} + + - name: Install dependencies + if: steps.cache.outputs.cache-hit != 'true' + run: yarn + + - name: Run tests + run: yarn test + + - name: Coverage + run: yarn codecov + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 1724cad6..a543cd06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,67 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [2.0.0-beta.2](https://github.com/nuxt-community/vuetify-module/compare/v2.0.0-beta.1...v2.0.0-beta.2) (2020-04-26) + + +### Bug Fixes + +* **deps:** optional fibers can be v4 or v5 ([4b350b7](https://github.com/nuxt-community/vuetify-module/commit/4b350b71666c751c11e1b66566109830cb475c5e)) + +## [2.0.0-beta.1](https://github.com/nuxt-community/vuetify-module/compare/v2.0.0-beta.0...v2.0.0-beta.1) (2020-04-26) + + +### Bug Fixes + +* bump dependencies & fix presets issue ([d65f5b8](https://github.com/nuxt-community/vuetify-module/commit/d65f5b8af775a8a818fe715f9ca52a69f605c5dd)) + +## [2.0.0-beta.0](https://github.com/nuxt-community/vuetify-module/compare/v2.0.0-alpha.5...v2.0.0-beta.0) (2020-02-17) + + +### Features + +* allow for list of custom fonts ([fa008f5](https://github.com/nuxt-community/vuetify-module/commit/fa008f54f39d31895a10e6e1186e0d400cdb3d64)), closes [#269](https://github.com/nuxt-community/vuetify-module/issues/269) + +## [2.0.0-alpha.5](https://github.com/nuxt-community/vuetify-module/compare/v2.0.0-alpha.4...v2.0.0-alpha.5) (2020-01-30) + + +### Bug Fixes + +* use minimal vuetify import ([bc2aa88](https://github.com/nuxt-community/vuetify-module/commit/bc2aa88c8ae1e8d2359ff06e4a460ca737454ae3)) + +## [2.0.0-alpha.4](https://github.com/nuxt-community/vuetify-module/compare/v2.0.0-alpha.3...v2.0.0-alpha.4) (2020-01-17) + + +### Bug Fixes + +* replace treeShake with globalImports ([#239](https://github.com/nuxt-community/vuetify-module/issues/239)) ([48e6bef](https://github.com/nuxt-community/vuetify-module/commit/48e6bef899b70b26e066f43b3d76e31658692cfb)) +* transpile 'vuetify' instead of 'vuetify/lib' ([059ca8c](https://github.com/nuxt-community/vuetify-module/commit/059ca8cffc90cdb6019a1d88a94264c5b7ff466e)) + +## [2.0.0-alpha.3](https://github.com/nuxt-community/vuetify-module/compare/v2.0.0-alpha.2...v2.0.0-alpha.3) (2020-01-15) + + +### Bug Fixes + +* update devDependencies & fix code ([e8de2c6](https://github.com/nuxt-community/vuetify-module/commit/e8de2c65085229c160c9876c3ece2a802d025aa4)) + +## [2.0.0-alpha.2](https://github.com/nuxt-community/vuetify-module/compare/v2.0.0-alpha.1...v2.0.0-alpha.2) (2020-01-13) + +## [2.0.0-alpha.1](https://github.com/nuxt-community/vuetify-module/compare/v2.0.0-alpha.0...v2.0.0-alpha.1) (2019-12-08) + + +### Features + +* progressive images ([e520284](https://github.com/nuxt-community/vuetify-module/commit/e5202844967431b2a0f769507cf4b489d17e9edc)), closes [#167](https://github.com/nuxt-community/vuetify-module/issues/167) + +## [2.0.0-alpha.0](https://github.com/nuxt-community/vuetify-module/compare/v1.9.0...v2.0.0-alpha.0) (2019-11-04) + + +### Bug Fixes + +* import vuetify styles if custom variables ([25a0847](https://github.com/nuxt-community/vuetify-module/commit/25a084747c5c21388cbf413e66594e69dd80d169)) +* **deps:** fibers is optional dependency ([#179](https://github.com/nuxt-community/vuetify-module/issues/179)) ([33962d4](https://github.com/nuxt-community/vuetify-module/commit/33962d4be6439a24476f30844751205d5385b960)) +* fixture module configuration ([45a1a7e](https://github.com/nuxt-community/vuetify-module/commit/45a1a7e087062bd9e91909ccc21527f4f0b6b49a)) + ## [1.9.0](https://github.com/nuxt-community/vuetify-module/compare/v1.8.6...v1.9.0) (2019-10-02) ### Notes diff --git a/README.md b/README.md index e04a627d..4c94d010 100755 --- a/README.md +++ b/README.md @@ -75,8 +75,9 @@ Usage example : $btn-border-radius: 0px; // If you need to extend Vuetify SASS lists +$material-light: ( cards: blue ); + @import '~vuetify/src/styles/styles.sass'; -$material-light: map-merge($material-light, ( cards: blue )); ``` ```js @@ -129,7 +130,8 @@ Here are the accepted values for this option : Please refer to [Vuetify Icons documentation](https://vuetifyjs.com/en/customization/icons) for more information about icons, notably for using only bunch of SVG icons instead of including all icons in your app. -You can also set the whole `defaultAssets` option to `false` to prevent any automatic add of these two assets. +You can also set the whole `defaultAssets` option to `false` to prevent any automatic add of these two assets. +You can read more about adding your own assets in the [Offline applications](https://github.com/nuxt-community/vuetify-module#offline-applications) section. ### `optionsPath` @@ -217,7 +219,7 @@ If you're building an application that will need to work offline (more likely a It means you must set [`defaultAssets`](#defaultAssets) option to `false`. -For fonts, you may leverage CSS [**@font-face**](https://www.w3schools.com/cssref/css3_pr_font-face_rule.asp) rule with local path of your fonts. +For fonts, you may leverage CSS [**@font-face**](https://www.w3schools.com/cssref/css3_pr_font-face_rule.asp) rule with local path of your fonts. You may find the [google webfonts helper](https://google-webfonts-helper.herokuapp.com/fonts/roboto?subsets=latin) site useful for generating **@font-face** rules and sourcing replacement files for the default CDNs. For icons, you can either use the same way than above, or leverage tree-shaken SVG libraries like [**Material Design Icons SVG**](https://github.com/Templarian/MaterialDesign-JS) or [**Font Awesome 5 SVG**](https://fontawesome.com/how-to-use/on-the-web/advanced/svg-javascript-core). diff --git a/package.json b/package.json index 69c34fbc..d6495269 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@nuxtjs/vuetify", - "version": "1.9.0", + "version": "2.0.0-beta.2", "description": "Vuetify Module for Nuxt.js", "license": "MIT", "contributors": [ @@ -19,7 +19,8 @@ }, "scripts": { "dev": "tsc && nuxt-ts test/fixture", - "build": "tsc", + "build": "yarn clean && tsc", + "clean": "rimraf dist", "lint": "eslint --ext .ts,.js,.vue .", "test": "yarn lint && jest", "release": "yarn test && yarn build && standard-version && git push --follow-tags && npm publish" @@ -30,28 +31,31 @@ ], "dependencies": { "deepmerge": "^4.2.2", - "fibers": "^4.0.2", - "sass": "^1.23.7", - "sass-loader": "^8.0.0", - "vuetify": "^2.1.13", + "sass": "^1.26.5", + "sass-loader": "^8.0.2", + "vuetify": "^2", "vuetify-loader": "^1.4.3" }, + "optionalDependencies": { + "fibers": "^4.0.0 || ^5.0.0" + }, "devDependencies": { - "@commitlint/cli": "latest", - "@commitlint/config-conventional": "latest", - "@nuxt/typescript-build": "latest", - "@nuxt/typescript-runtime": "latest", - "@nuxtjs/eslint-config-typescript": "latest", - "@types/jest": "latest", - "@types/sass": "latest", - "codecov": "latest", - "eslint": "latest", - "husky": "latest", - "jest": "latest", - "nuxt-edge": "latest", + "@commitlint/cli": "^8.3.5", + "@commitlint/config-conventional": "^8.3.4", + "@nuxt/typescript-build": "^0.6.6", + "@nuxt/typescript-runtime": "^0.4.6", + "@nuxtjs/eslint-config-typescript": "^1.0.2", + "@types/jest": "^25.2.1", + "@types/sass": "^1.16.0", + "codecov": "^3.6.5", + "eslint": "^6.8.0", + "husky": "^4.2.5", + "jest": "^25.4.0", + "nuxt-edge": "^2.12.0-26317452.ce3a05c2", "nuxt-webfontloader": "^1.1.0", - "standard-version": "latest", - "ts-jest": "latest", - "typescript": "~3.6" + "rimraf": "^3.0.2", + "standard-version": "^7.1.0", + "ts-jest": "^25.4.0", + "typescript": "~3.8" } } diff --git a/src/build.ts b/src/build.ts deleted file mode 100644 index 98fe583d..00000000 --- a/src/build.ts +++ /dev/null @@ -1,50 +0,0 @@ -import path from 'path' -import fs from 'fs' -import { ModuleThis } from '@nuxt/types/config/module' -import { Options } from './options' - -export default function setupBuild (this: ModuleThis, options: Options) { - if (!options.treeShake) { - this.options.css!.push('vuetify/dist/vuetify.css') - } - - // Enable tree-shaking with VuetifyLoader (https://github.com/vuetifyjs/vuetify-loader) - if (options.treeShake) { - const VuetifyLoaderPlugin = this.nuxt.resolver.requireModule('vuetify-loader/lib/plugin') - - this.options.build!.transpile!.push('vuetify/lib') - - this.extendBuild((config) => { - config.plugins!.push(new VuetifyLoaderPlugin(typeof options.treeShake === 'object' ? options.treeShake.loaderOptions : {})) - }) - } - - // Remove module options - const vuetifyOptions = { ...options } - delete vuetifyOptions.customVariables - delete vuetifyOptions.defaultAssets - delete vuetifyOptions.optionsPath - delete vuetifyOptions.treeShake - - let optionsPath: string | null = this.nuxt.resolver.resolveAlias(options.optionsPath || - path.join(this.options.dir!.app || 'app', 'vuetify', 'options.js')) - - optionsPath = fs.existsSync(optionsPath!) ? optionsPath : null - - // Register options template - this.addTemplate({ - fileName: `vuetify/options.${optionsPath && optionsPath.endsWith('ts') ? 'ts' : 'js'}`, - src: optionsPath || path.resolve(__dirname, '../templates', 'options.js'), - options: vuetifyOptions - }) - - // Register plugin - this.addPlugin({ - fileName: 'vuetify/plugin.js', - src: path.resolve(__dirname, '../templates', 'plugin.js'), - options: { - defaultIconPreset: options.defaultAssets && options.defaultAssets.icons, - treeShake: options.treeShake - } - }) -} diff --git a/src/font.ts b/src/font.ts index 598bb8c5..0aaed363 100644 --- a/src/font.ts +++ b/src/font.ts @@ -1,7 +1,8 @@ import { ModuleThis } from '@nuxt/types/config/module' +import { prependData as sassPrependData } from './sass' export interface FontOptions { - family?: string + family?: string | string[] size?: number } @@ -22,11 +23,12 @@ export default function setupFont (this: ModuleThis, options: FontOptions) { // Add font-family custom variable (only if not Roboto, cause already default in Vuetify styles) if (options.family !== 'Roboto') { - this.options.build!.loaders.sass.prependData = [`$body-font-family: '${options.family}', sans-serif`, this.options.build!.loaders.sass.prependData].join('\n') + const userFontFamily = Array.isArray(options.family) + ? options.family.map(x => `'${x}'`).join(', ') + : `'${options.family}'` + sassPrependData.call(this, `$body-font-family: ${userFontFamily}, sans-serif`) } // Add font-size custom variable - if (options.size) { - this.options.build!.loaders.sass.prependData = [`$font-size-root: ${options.size}px`, this.options.build!.loaders.sass.prependData].join('\n') - } + options.size && sassPrependData.call(this, `$font-size-root: ${options.size}px`) } diff --git a/src/icons.ts b/src/icons.ts index 58d98589..2d77b1e9 100644 --- a/src/icons.ts +++ b/src/icons.ts @@ -1,18 +1,21 @@ import { ModuleThis } from '@nuxt/types/config/module' const presetsCDN = { - 'mdi': 'https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css', - 'md': 'https://fonts.googleapis.com/css?family=Material+Icons', - 'fa': 'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@latest/css/all.min.css', - 'fa4': 'https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css' + mdi: 'https://cdn.jsdelivr.net/npm/@mdi/font@latest/css/materialdesignicons.min.css', + md: 'https://fonts.googleapis.com/css?family=Material+Icons', + fa: 'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@latest/css/all.min.css', + fa4: 'https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css' } export type IconPreset = keyof typeof presetsCDN export default function setupIcons (this: ModuleThis, preset: IconPreset) { - this.options.head!.link!.push({ - rel: 'stylesheet', - type: 'text/css', - href: presetsCDN[preset] - }) + // istanbul ignore else + if (presetsCDN[preset]) { + this.options.head!.link!.push({ + rel: 'stylesheet', + type: 'text/css', + href: presetsCDN[preset] + }) + } } diff --git a/src/index.ts b/src/index.ts index 95943957..507b4f0c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,10 +1,11 @@ import { Module } from '@nuxt/types' import { Framework } from 'vuetify' -import initOptions, { Options, TreeShakeOptions, VuetifyLoaderOptions } from './options' -import setupBuild from './build' +import initOptions, { Options } from './options' +import setupLoader, { VuetifyLoaderOptions } from './loader' import setupFont from './font' import setupIcons from './icons' +import setupPlugin from './plugin' import setupSass from './sass' declare module '@nuxt/types' { @@ -21,19 +22,21 @@ const vuetifyModule: Module = function (moduleOptions) { this.nuxt.hook('build:before', () => { const options = initOptions.call(this, moduleOptions) + setupSass.call(this, options.customVariables) + if (typeof options.defaultAssets === 'object') { options.defaultAssets.font && setupFont.call(this, options.defaultAssets.font) options.defaultAssets.icons && setupIcons.call(this, options.defaultAssets.icons) } - setupSass.call(this, options.customVariables) - setupBuild.call(this, options) + options.loader && setupLoader.call(this, options.loader) + + setupPlugin.call(this, options) }) } export { Options, - TreeShakeOptions, VuetifyLoaderOptions } diff --git a/src/loader.ts b/src/loader.ts new file mode 100644 index 00000000..8e1723f4 --- /dev/null +++ b/src/loader.ts @@ -0,0 +1,28 @@ +import { ModuleThis } from '@nuxt/types/config/module' +import { SFCDescriptor } from 'vue-template-compiler' +import { Options } from './options' + +// https://github.com/vuetifyjs/vuetify-loader#automatic-imports + +export interface VuetifyLoaderOptions { + match?(originalTag: string, context: { + kebabTag: string, + camelTag: string, + path: string, + component: SFCDescriptor + }): Array<[string, string]> + progressiveImages?: boolean | { + graphicsMagick?: boolean + resourceQuery?: RegExp + sharp?: boolean + size?: number + } +} + +export default function setupLoader (this: ModuleThis, options: Options['loader']) { + const VuetifyLoaderPlugin = this.nuxt.resolver.requireModule('vuetify-loader/lib/plugin') + + this.extendBuild((config) => { + config.plugins!.push(new VuetifyLoaderPlugin(typeof options === 'object' ? options : {})) + }) +} diff --git a/src/options.ts b/src/options.ts index 81f0798e..edb536a9 100644 --- a/src/options.ts +++ b/src/options.ts @@ -1,48 +1,38 @@ import merge from 'deepmerge' -import { SFCDescriptor } from 'vue-template-compiler' -import { VuetifyPreset } from 'vuetify/types/presets' +import { VuetifyPreset } from 'vuetify/types/services/presets' import { ModuleThis } from '@nuxt/types/config/module' +import { VuetifyLoaderOptions } from './loader' import { FontOptions } from './font' import { IconPreset } from './icons' -export interface TreeShakeOptions { +export interface GlobalImports { components?: string[] directives?: string[] - loaderOptions?: VuetifyLoaderOptions transitions?: string[] } -export interface VuetifyLoaderOptions { - match?(originalTag: string, context: { - kebabTag: string, - camelTag: string, - path: string, - component: SFCDescriptor - }): Array<[string, string]> -} - -export interface Options extends Partial { +export interface Options { customVariables?: string[] defaultAssets?: { font?: FontOptions, icons?: IconPreset | false } | false - optionsPath?: string - treeShake?: boolean | TreeShakeOptions + frameworkOptions?: string | Partial + globalImports?: GlobalImports + loader?: boolean | VuetifyLoaderOptions + preset?: string } export const defaults = { - customVariables: [], defaultAssets: { font: { family: 'Roboto' }, icons: 'mdi' as IconPreset }, - optionsPath: undefined, - treeShake: process.env.NODE_ENV === 'production' + loader: true } export default function initOptions (this: ModuleThis, moduleOptions?: Options): Required { diff --git a/src/plugin.ts b/src/plugin.ts new file mode 100644 index 00000000..1e6786d0 --- /dev/null +++ b/src/plugin.ts @@ -0,0 +1,28 @@ +import path from 'path' +import { ModuleThis } from '@nuxt/types/config/module' +import { Options } from './options' + +export default function setupPlugin (this: ModuleThis, options: Options) { + // Transpile Vuetify + this.options.build!.transpile!.push('vuetify') + + const optionsPath = typeof options.frameworkOptions === 'string' && this.nuxt.resolver.resolveAlias(options.frameworkOptions) + + // Register options template + this.addTemplate({ + fileName: `vuetify/options.${optionsPath && optionsPath.endsWith('ts') ? 'ts' : 'js'}`, + src: optionsPath || path.resolve(__dirname, '../templates', 'options.js'), + options: options.frameworkOptions || {} + }) + + // Register plugin + this.addPlugin({ + fileName: 'vuetify/plugin.js', + src: path.resolve(__dirname, '../templates', 'plugin.js'), + options: { + defaultIconPreset: options.defaultAssets && options.defaultAssets.icons, + globalImports: options.globalImports, + preset: options.preset + } + }) +} diff --git a/src/sass.ts b/src/sass.ts index 9989fd19..b51296ec 100644 --- a/src/sass.ts +++ b/src/sass.ts @@ -1,9 +1,17 @@ +import { NuxtConfigurationLoaders } from '@nuxt/types/config/build' import { ModuleThis } from '@nuxt/types/config/module' import dartSass from 'sass' import { Options } from './options' +export function prependData (this: ModuleThis, ...datas: string[]) { + const { sass, scss } = this.options.build!.loaders as Required> + + sass.prependData = [sass.prependData, ...datas].join('\n') + scss.prependData = [scss.prependData, ...datas.map(d => d + ';')].join('\n') +} + export default function setupSass (this: ModuleThis, customVariables: Options['customVariables']) { - const { sass, scss } = this.options.build!.loaders + const { sass, scss } = this.options.build!.loaders as Required> // Use Dart Sass sass.implementation = scss.implementation = dartSass @@ -18,9 +26,7 @@ export default function setupSass (this: ModuleThis, customVariables: Options['c // Custom variables if (customVariables && customVariables.length > 0) { - const sassImports = customVariables.map(path => `@import '${path}'`).join('\n') - sass.prependData = [sass.prependData, sassImports].join('\n') - const scssImports = customVariables.map(path => `@import '${path}';`).join('\n') - scss.prependData = [scss.prependData, scssImports].join('\n') + prependData.call(this, ...customVariables.map(path => `@import '${path}'`)) + prependData.call(this, "@import '~vuetify/src/styles/styles.sass'") } } diff --git a/templates/plugin.js b/templates/plugin.js index 3c110992..0f4d0c21 100644 --- a/templates/plugin.js +++ b/templates/plugin.js @@ -1,16 +1,20 @@ import Vue from 'vue' -import Vuetify from '<%= options.treeShake ? 'vuetify/lib' : 'vuetify' %>' +import Vuetify from 'vuetify/lib/framework' +<% if (options.preset) { %> +import { preset } from '<%= options.preset %>' +<% } %> + <% const libImports = [ { key: 'components', location: 'vuetify/lib'}, { key: 'transitions', location: 'vuetify/lib'}, { key: 'directives', location: 'vuetify/lib/directives'} ] -if (options.treeShake) { +if (options.globalImports) { for (const lib of libImports) { - if (options.treeShake[lib.key] && options.treeShake[lib.key].length > 0) { + if (options.globalImports[lib.key] && options.globalImports[lib.key].length > 0) { %> -import { <%= options.treeShake[lib.key].join(', ') %> } from '<%= lib.location %>' +import { <%= options.globalImports[lib.key].join(', ') %> } from '<%= lib.location %>' <% } } @@ -20,9 +24,9 @@ import { <%= options.treeShake[lib.key].join(', ') %> } from '<%= lib.location % import options from './options' Vue.use(Vuetify, { -<% if (options.treeShake) { %> -<%= libImports.filter(lib => options.treeShake[lib.key] && options.treeShake[lib.key].length > 0) - .map(lib => ` ${lib.key}: { ${options.treeShake[lib.key].join(', ')} }`) +<% if (options.globalImports) { %> +<%= libImports.filter(lib => options.globalImports[lib.key] && options.globalImports[lib.key].length > 0) + .map(lib => ` ${lib.key}: { ${options.globalImports[lib.key].join(', ')} }`) .join(',\n') %> <% } %> }) @@ -34,6 +38,9 @@ export default (ctx) => { vuetifyOptions.icons = vuetifyOptions.icons || {} vuetifyOptions.icons.iconfont = '<%= options.defaultIconPreset %>' <% } %> +<% if (options.preset) { %> + vuetifyOptions.preset = preset +<% } %> const vuetify = new Vuetify(vuetifyOptions) diff --git a/test/fixture/assets/variables.scss b/test/fixture/assets/variables.scss deleted file mode 100644 index eddcf778..00000000 --- a/test/fixture/assets/variables.scss +++ /dev/null @@ -1 +0,0 @@ -$font-size-root: 20px; diff --git a/test/fixture/layouts/default.vue b/test/fixture/layouts/default.vue index 8da4d895..a40c2826 100644 --- a/test/fixture/layouts/default.vue +++ b/test/fixture/layouts/default.vue @@ -54,7 +54,7 @@ Youtube - + - + @@ -75,9 +75,6 @@ diff --git a/test/fixture/nuxt.config.ts b/test/fixture/nuxt.config.ts index eb184025..29f533ad 100644 --- a/test/fixture/nuxt.config.ts +++ b/test/fixture/nuxt.config.ts @@ -11,8 +11,13 @@ const config: Partial = { buildModules: [typescriptModule, vuetifyModule], vuetify: { - customVariables: ['~/assets/variables.scss'], - optionsPath: './vuetify.options.ts' + defaultAssets: { + font: { + family: 'Montserrat', + size: 20 + } + }, + frameworkOptions: './vuetify.options.ts' } } diff --git a/test/fixture/pages/dynamic-component.vue b/test/fixture/pages/dynamic-component.vue deleted file mode 100644 index 282ecfcc..00000000 --- a/test/fixture/pages/dynamic-component.vue +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/test/fixture/pages/index.vue b/test/fixture/pages/index.vue index 40a2c15d..0ca7f486 100644 --- a/test/fixture/pages/index.vue +++ b/test/fixture/pages/index.vue @@ -1,7 +1,7 @@