Skip to content

Commit

Permalink
fix: remove sass processing in testing env
Browse files Browse the repository at this point in the history
fixes #101
  • Loading branch information
johnleider committed Oct 6, 2019
1 parent 4e84c85 commit 9169fac
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,21 @@ module.exports = (api) => {
}))
})

// Avoid loading styles in testing
if (process.env.NODE_ENV === 'test') {
api.chainWebpack(config => {
const sassRule = config.module.rule('sass')
sassRule.uses.clear()
sassRule.use('null-loader').loader('null-loader')

const scssRule = config.module.rule('scss')
scssRule.uses.clear()
scssRule.use('null-loader').loader('null-loader')
})

return
}

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

0 comments on commit 9169fac

Please sign in to comment.