New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@foxman/plugin-automount

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@foxman/plugin-automount

Router 自动刷新

npmnpm
Version
1.0.0-1
Version published
Weekly downloads
0
Maintainers
2
Weekly downloads
 
Created
Source

Automount

Foxman-Plugin

如何启用

  • cd path/to/project(以启用 foxman 的工程)
  • npm i --save-dev foxman-plugin-automount
  • 在 foxman.config.js 中新增 plugins 的配置项
const Automount = require('foxman-plugin-automount');
module.exports = {
    ...
    plugins: [
        new Automount({
            tplUrlMap: {
                '/index.html': 'index',
                '/index2.html': 'index',
            },
            /**
             * 同步接口 xxx.ftl 映射实际url的接口,默认如下
             * @param ftlPath(不带后缀)
             * @returns {string|*|XML|void} 
             */
            syncDataMatch: ftlPath => { 
                return '/' + ftlPath + '.html'; 
            },
            /**
             * 异步接口 xxx.json 映射实际url的接口,默认如下
             * @param dataPath(不带后缀)
             * @returns {string|*|XML|void} 
             */
            asyncDataMatch: dataPath => {
                return '/' + dataPath + '.html'; 
            }
        })
    ],
    ...
}

查看例子

FAQs

Package last updated on 27 Apr 2017

Related posts