No Proscribed Meaning

    wepy-mock-webpack-plugin

    1.0.5 • Public • Published

    vue to wepy plugin

    插件的主要作用是将符合https://www.npmjs.com/package/start-server规范的mock文件夹内容,转化成wepy的mock模块。

    比如一个目录如下的项目: docs/ mocks/ src dist

    这样调用插件:

    plugins:[
        new WepyMockPlugin({
            mockPath:path.join(__dirname,'./docs/mocks'),
            distPath:path.join(__dirname,"./wepy-source/mocks"),
            watch:true
        })
    ]
    

    项目里这样去请求mock数据:

    import mockJsModuleServer from '../mocks';//mocks的文件,webpack自动生成的目录
    mockJsModuleServer({
        url:"/node/?d=xx&c=xx&m=xx",//支持dcm路由和普通路由 /node/xx/xx/xx
    })
    //返回的是个promise

    Keywords

    none

    Install

    npm i wepy-mock-webpack-plugin

    DownloadsWeekly Downloads

    0

    Version

    1.0.5

    License

    ISC

    Unpacked Size

    24.9 kB

    Total Files

    13

    Last publish

    Collaborators

    • xiaomingplus