亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

node.js - Why exports readyPromise in dev-server.js in vuejs-templates/webpack?
僅有的幸福
僅有的幸福 2017-07-03 11:42:45
0
1
1133

Look at the source codedev-server.js is only called by node.js in package.json, as follows:

    "start": "node build/dev-server.js",

But are the exports in dev-server.js returned to node.js? How will node.js use the returned readyPromise?

The address of

vuejs-templates/webpack is:
https://github.com/vuejs-temp...

僅有的幸福
僅有的幸福

reply all(1)
滿天的星座

The purpose of exporting readyPromise here is to provide a hook for users to perform customized operations after webpack packaging is completed. You can introduce the export of dev-server.js in a script,

//custom.js
let devServer = require('dev-server.js')
devServer.then(()=>{
    //執(zhí)行自定義的操作
})

Replace the original start task content in packge.json with "node build/dev-server.js", so that npm run start will perform customized operations

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template