# vue-component-compiler
**Repository Path**: mirrors_PatrickJS/vue-component-compiler
## Basic Information
- **Project Name**: vue-component-compiler
- **Description**: Compile a single file Vue component into a CommonJS module.
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-08-19
- **Last Updated**: 2026-05-23
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# vue-component-compiler
[](http://badge.fury.io/js/vue-component-compiler) [](https://travis-ci.org/vuejs/vue-component-compiler)
This module compile a single file Vue component like the one below into a CommonJS module that can be used in Browserify/Webpack/Component/Duo builds.
Currently supported preprocessors are:
- stylus
- less
- scss (via `node-sass`)
- jade
- coffee-script
- myth
- es6 (via `6to5` aka `babel`)
## Example
``` html
// app.vue
{{msg}}
```
You can also mix preprocessor languages in the component file:
``` html
// app.vue
h1(class="red") {{msg}}
```
And you can import using the `src` attribute:
``` html
```
## API
``` js
var compiler = require('vue-component-compiler')
// filePath should be an absolute path, and is optional if
// the fileContent doesn't contain src imports
compiler.compile(fileContent, filePath, function (err, result) {
// result is a common js module string
})
```