A fisx parser to compile the vue single file component support vue1 and vue2.
npm install fisx-parser-vue --save-dev
// 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.
-
styleNameJoin -
string
optional
: 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.css
-
template -
Object
optional
: define the template compile option, the detail option information referfisx-vue-loader
orfisx-vue1-loader
. -
script -
Object
optional
: define the script compile option, the detail option information referfisx-vue-loader
orfisx-vue1-loader
. -
style -
Object
optional
: define the style compile option, the detail option information referfisx-vue-loader
orfisx-vue1-loader
. -
sourceMap -
boolean
optional
: whether output the source map information file, by defaultfalse
-
isProduction -
boolean
optional
: whether release in production environment, by defaulttrue