Skip to content

Commit

Permalink
fix: build css unhandled promise
Browse files Browse the repository at this point in the history
  • Loading branch information
luthfimasruri committed Mar 29, 2021
1 parent 9895952 commit c84470d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 26 deletions.
2 changes: 1 addition & 1 deletion packages/vue-quill/src/assets/snow.styl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ backgroundColor = #fff
inactiveColor = #4B5563
shadowColor = #D1D5DB
textColor = #4B5563
// Additional colors
// Additional color
backgroundHoverColor = #F3F4F6
backgroundActiveColor = #DBEAFE

Expand Down
31 changes: 6 additions & 25 deletions scripts/buildAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,17 @@ npm run assets:build -- vue-quill
}

async function buildAssets(target: string) {
const rootDir = path.resolve(__dirname, '..')
const pkgDir = path.resolve(__dirname, `../packages/${target}`)
const assets = require(path.resolve(pkgDir, 'assets.config.json'))

// only build published packages for release
if (isRelease && assets.private) return
if (!assets.css.length) return
console.log(
chalk.cyan(`\n>>>>>>>>>>>>>>>>>>>> BUILD ASSETS <<<<<<<<<<<<<<<<<<<<`)
)

assets.css.forEach(async (css: any) => {
await assets.css.forEach(async (css: any) => {
const input = path.resolve(pkgDir, css.input)
const inputExt = path.extname(input)
const output = path.resolve(pkgDir, css.output)
Expand All @@ -70,30 +72,9 @@ npm run assets:build -- vue-quill
)

if (inputExt === '.styl' || inputExt === '.css') {
if (!prodOnly) {
console.log(
chalk.cyan(`${input}${path.relative(rootDir, output)}...`)
)
execa.sync('stylus', [input, '-o', output])
console.log(
chalk.green(
`created: ${chalk.bold(path.relative(rootDir, output))}\n`
)
)
}

if (!prodOnly) await execa('stylus', [input, '-o', output], { stdio: 'inherit' })
// create production build
if (!devOnly) {
console.log(
chalk.cyan(`${input}${path.relative(rootDir, outputProd)}...`)
)
execa.sync('stylus', [input, '-o', outputProd, '-c'])
console.log(
chalk.green(
`created: ${chalk.bold(path.relative(rootDir, outputProd))}\n`
)
)
}
if (!devOnly) await execa('stylus', [input, '-o', outputProd, '-c'], { stdio: 'inherit' })
} else {
console.log(chalk.redBright(`File extention not supported: ${input}`))
}
Expand Down

0 comments on commit c84470d

Please sign in to comment.