Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): updates for alpha 11. #297

Merged
merged 7 commits into from
Sep 29, 2021
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import '@mdi/font/css/materialdesignicons.css'
johnleider marked this conversation as resolved.
Show resolved Hide resolved
import 'vuetify/lib/styles/main.sass'
import 'vuetify/styles'
import { createVuetify } from 'vuetify'
import * as components from 'vuetify/lib/components'
import * as directives from 'vuetify/lib/directives'

export default createVuetify({
components,
directives,
})
export default createVuetify()
ElijahKotyluk marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite';
ElijahKotyluk marked this conversation as resolved.
Show resolved Hide resolved
import vue from '@vitejs/plugin-vue';
import vuetify from '@vuetify/vite-plugin';

import path from 'path'
const srcPath = path.resolve(__dirname, 'src', 'styles', 'variables.scss')
import path from 'path';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
plugins: [
vue(),
vuetify({
autoimport: true,
}),
],
define: { 'process.env': {} },
css: {
preprocessorOptions: {
sass: { additionalData: `@import ${srcPath}\n` },
scss: { additionalData: `@import ${srcPath};\n` },
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
},
},
/* remove the need to specify .vue files https://vitejs.dev/config/#resolve-extensions
Expand All @@ -27,4 +31,4 @@ export default defineConfig({
]
},
*/
})
});
7 changes: 4 additions & 3 deletions packages/vue-cli-plugin-vuetify/generator/tools/alaCarte.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
function addDependencies (api, useV3) {
const deps = {
devDependencies: {
sass: '~1.32.0',
sass: useV3 ? '^1.38.0' : '~1.32.0',
'sass-loader': '^10.0.0',
'vuetify-loader': useV3 ? '^2.0.0-alpha.0' : '^1.7.0',
},
}
};

if (!useV3) deps.devDependencies['vuetify-loader'] = '^1.7.0'
if (useV3) deps.devDependencies['@vue/cli-service'] = '~5.0.0-beta.3'

api.extendPackage(deps)
}
Expand Down
1 change: 1 addition & 0 deletions packages/vue-cli-plugin-vuetify/generator/tools/vite.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ function addDependencies (api) {
api.extendPackage({
devDependencies: {
'@vitejs/plugin-vue': '^1.2.4',
'@vuetify/vite-plugin': '^1.0.0-alpha.3',
vite: '^2.0.0',
},
scripts: {
Expand Down
5 changes: 4 additions & 1 deletion packages/vue-cli-plugin-vuetify/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// Imports
const { mergeRules } = require('./util/helpers')

const semver = require('semver')

module.exports = (api) => {
const dependencies = api.service.pkg.dependencies || {}
const devDependencies = api.service.pkg.devDependencies || {}
Expand All @@ -11,7 +13,8 @@ module.exports = (api) => {
)

if (hasVuetifyLoader) {
const VuetifyLoaderPlugin = require('vuetify-loader/lib/plugin')
const vueVersion = semver.major(require('vue/package.json').version)
const VuetifyLoaderPlugin = vueVersion === 3 ? require('vuetify-loader').VuetifyLoaderPlugin : require('vuetify-loader/lib/plugin')

api.chainWebpack(config => {
config
Expand Down