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...
滿天的星座2017-07-03 11:44:45
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(()=>{
//执行自定义的操作
})
Replace the original start task content in packge.json with "node build/dev-server.js", so that npm run start will perform customized operations