How to use the @vue/component-compiler-utils.compileStyleAsync function in @vue/component-compiler-utils

To help you get started, we’ve selected a few @vue/component-compiler-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ktsn / vue-template-loader / lib / scoped-style-loader.js View on Github external
module.exports = function (rawStyle, prevMap) {
  const cb = this.async()
  const { id } = loaderUtils.getOptions(this)

  assert(id)

  compileStyleAsync({
    source: rawStyle,
    filename: this.resourcePath,
    id: 'data-v-' + id,
    map: prevMap,
    scoped: true
  }).then(
    result => {
      if (result.errors.length > 0) {
        cb(result.errors.join('\n'))
        return
      }
      cb(null, result.code, result.map)
    },
    err => cb(err)
  )
}

@vue/component-compiler-utils

Lower level utilities for compiling Vue single file components

MIT
Latest version published 3 years ago

Package Health Score

66 / 100
Full package analysis