Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async prepare({ dev }) {
console.log('> Building from source')
// Load user config
const { data, path: configPath } = await config.load(
[
'peco.config.yml',
'peco.config.toml',
'peco.config.js',
'peco.config.json'
],
this.options.baseDir
)
this.configPath = configPath
await this.normalizeConfig(data)
const postcssConfig = await require('postcss-load-config')({
cwd: this.options.baseDir,
argv: false
}).catch(err => {
if (err.message.includes('No PostCSS Config found')) {
// Return empty options for PostCSS
return {}
}
throw err
})
if (postcssConfig.file) {
this.postcss = {
config: {
path: postcssConfig.file
}
}