Skip to content

Commit aea1b79

Browse files
committed
chore: make prettier dependency optional
closes #84
1 parent b541fef commit aea1b79

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

lib/compileTemplate.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ function actuallyCompile(
176176
parser: 'babel'
177177
})
178178
} catch (e) {
179+
if (e.code === 'MODULE_NOT_FOUND') {
180+
tips.push(
181+
'The `prettify` option is on, but the dependency `prettier` is not found.\n' +
182+
'Please either turn off `prettify` or manually install `prettier`.'
183+
)
184+
}
179185
tips.push(
180186
`Failed to prettify component ${options.filename} template source after compilation.`
181187
)

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,10 @@
6262
"merge-source-map": "^1.1.0",
6363
"postcss": "^7.0.14",
6464
"postcss-selector-parser": "^6.0.2",
65-
"prettier": "^1.18.2",
6665
"source-map": "~0.6.1",
6766
"vue-template-es2015-compiler": "^1.9.0"
67+
},
68+
"optionalDependencies": {
69+
"prettier": "^1.18.2"
6870
}
6971
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy