fisx-parser-vue v0.1.1
fisx-parser-vue
A fisx parser to compile the vue single file component support vue1 and vue2.
How to use
Install
npm install fisx-parser-vue --save-devAdd configure to fis-conf.js
// using vue1
fis.require('parser-vue').parser = require('fisx-vue1-loader');
// using vue2
// fis.require('parser-vue').parser = require('fisx-vue-loader');
fis.match('/src/(**.vue)', {
rExt: 'vue.js',
relative: true,
parser: fis.plugin('vue', {
script: {
lang: 'babel'
}
}),
preprocessor: [
fis.plugin('babel'), // when
fis.plugin('amd')
]
});For Vue 1.x parser using fisx-vue1-loader
For Vue 2.x parser using fisx-vue-loader
If you using babel-plugin-external-helpers plugin, you can use fisx-preprocessor-babel and fisx-prepackager-babel plugins. If the module style is commonjs, you can use fisx-preprocessor-amd preprocessor to convert to amd module style.
Options
styleNameJoin -
stringoptional: define the extracted style output file name join part, by defaultvue-part, e.g., the vue file isa.vue, the extracted style output file name isa-vue-part.csstemplate -
Objectoptional: define the template compile option, the detail option information referfisx-vue-loaderorfisx-vue1-loader.script -
Objectoptional: define the script compile option, the detail option information referfisx-vue-loaderorfisx-vue1-loader.style -
Objectoptional: define the style compile option, the detail option information referfisx-vue-loaderorfisx-vue1-loader.sourceMap -
booleanoptional: whether output the source map information file, by defaultfalseisProduction -
booleanoptional: whether release in production environment, by defaulttrue