Skip to content

Commit

Permalink
fix(service): apply default objects to package.json dep/devDep proper…
Browse files Browse the repository at this point in the history
…ties
  • Loading branch information
johnleider committed Oct 7, 2019
1 parent be91c29 commit 80f727b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ function mergeRules (opt, sass = true, type) {
}

module.exports = (api) => {
const dependencies = api.service.pkg.dependencies || {}
const devDependencies = api.service.pkg.devDependencies || {}

const hasVuetifyLoader = Boolean(
api.service.pkg.devDependencies['vuetify-loader'] ||
api.service.pkg.dependencies['vuetify-loader']
devDependencies['vuetify-loader'] ||
dependencies['vuetify-loader']
)

if (hasVuetifyLoader) {
Expand Down Expand Up @@ -66,13 +69,12 @@ module.exports = (api) => {
}

// Bootstrap SASS Variables
let type
const hasSassVariables = fs.existsSync(api.resolve('src/sass/variables.sass'))
const hasScssVariables = fs.existsSync(api.resolve('src/sass/variables.scss'))

if (!hasSassVariables && !hasScssVariables) return

type = hasSassVariables ? 'sass' : 'scss'
const type = hasSassVariables ? 'sass' : 'scss'

api.chainWebpack(config => {
['vue-modules', 'vue', 'normal-modules', 'normal'].forEach(match => {
Expand Down

0 comments on commit 80f727b

Please sign in to comment.