fisx-hook-amd
A hook to compile amd modules for fisx.
How to use
The hook is default installed by fisx.
fis-conf.js
Add configure to fis.hook('amd', { config: { baseUrl: 'src' }});
Options
-
ignore -
Array|Function
:optional
configure the files to ignore compile, the array value can beglob
pattern orregexp
. You also can pass a function to determin whether ignore:{// if wanna ignore, return true}// you can aslo using file attribute `ignoreAMD` to ignore some specified files.fis; -
config -
Object
: the AMD modulerequire.config
definition, by default the configuration is defined inpackage.json
, so you can pass the configure like beblow:config: fis -
externals -
Array
: specify the external module ids:externals:'jquery'/vue\-hot\-reload\-api$/// the AMD require shim configshim:jquery:exports: '$' -
dynamic -
Array
: specify the dynamic generated module ids while compiling:{ dynamic: [ 'babelHelpers' ] }
-
extNames -
Array
: specify the amd module extension names, by default:['.js', '.vue']
:{ extNames: [ '.js', '.vue' ] }
-
parseScript -
Function
:optional
parsing page amd modules, the option is used when the page is not standard html file, e.g., smarty template file:{if !infoisInlinereturn;// parse the inline script in page filereturnasynDeps: fisutil;}