Skip to content

Commit 80f727b

Browse files
committed
fix(service): apply default objects to package.json dep/devDep properties
1 parent be91c29 commit 80f727b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

index.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ function mergeRules (opt, sass = true, type) {
1515
}
1616

1717
module.exports = (api) => {
18+
const dependencies = api.service.pkg.dependencies || {}
19+
const devDependencies = api.service.pkg.devDependencies || {}
20+
1821
const hasVuetifyLoader = Boolean(
19-
api.service.pkg.devDependencies['vuetify-loader'] ||
20-
api.service.pkg.dependencies['vuetify-loader']
22+
devDependencies['vuetify-loader'] ||
23+
dependencies['vuetify-loader']
2124
)
2225

2326
if (hasVuetifyLoader) {
@@ -66,13 +69,12 @@ module.exports = (api) => {
6669
}
6770

6871
// Bootstrap SASS Variables
69-
let type
7072
const hasSassVariables = fs.existsSync(api.resolve('src/sass/variables.sass'))
7173
const hasScssVariables = fs.existsSync(api.resolve('src/sass/variables.scss'))
7274

7375
if (!hasSassVariables && !hasScssVariables) return
7476

75-
type = hasSassVariables ? 'sass' : 'scss'
77+
const type = hasSassVariables ? 'sass' : 'scss'
7678

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

0 commit comments

Comments
 (0)