Skip to content

Commit c9f3fd2

Browse files
author
vasia
committed
replace throw to log
1 parent dd57354 commit c9f3fd2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/compilers/postcss-compiler.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ const postcss = require('postcss')
22
const postcssrc = require('postcss-load-config')
33
const ctx = { parser: true, map: 'inline' }
44
const { plugins } = postcssrc.sync(ctx)
5+
const logger = require('../logger')
6+
const getVueJestConfig = require('../get-vue-jest-config')
57

6-
const throwError = require('../throw-error')
7-
8-
module.exports = (content) => {
8+
module.exports = (content, filePath, jestConfig) => {
99
let css = null
1010

1111
postcss(plugins)
@@ -17,7 +17,10 @@ module.exports = (content) => {
1717
})
1818
.catch((e) => {
1919
css = ''
20-
throwError(e)
20+
if (!getVueJestConfig(jestConfig).hideStyleWarn) {
21+
logger.warn(`There was an error rendering the POSTCSS in ${filePath}. `)
22+
logger.warn(`Error while compiling styles: ${e}`)
23+
}
2124
})
2225

2326
while (css === null) { //eslint-disable-line

0 commit comments

Comments
 (0)