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
akababel
)
Also see Registering Custom Pre-Processors.
Example
// app.vue{{msg}}
You can also mix preprocessor languages in the component file:
// app.vue
And you can import using the src
attribute:
API
var compiler =// filePath should be an absolute path, and is optional if// the fileContent doesn't contain src importscompiler
Registering Custom Pre-Processors
Create a vue.config.js
file at where your build command is run (usually the root level of your project):
module {// register a compile function for <script lang="es">compiler}