看vuex 的例子,有一个配置不清楚,在vuex examples server.js 中一个配置 publicPath: '/__build__/' , '/__build__/'是在那个目录,运行起来没有这个目录?
配置:
//server.jsconst express = require('express')const webpack = require('webpack')const webpackDevMiddleware = require('webpack-dev-middleware')const webpackHotMiddleware = require('webpack-hot-middleware')const WebpackConfig = require('./webpack.config')const app = express()const compiler = webpack(WebpackConfig)
app.use(webpackDevMiddleware(compiler, {
publicPath: '/__build__/',//这个路径是在那?
stats: {
colors: true,
chunks: false
}
}))
app.use(webpackHotMiddleware(compiler))
app.use(express.static(__dirname))const port = process.env.PORT || 8080module.exports = app.listen(port, () => {
console.log(`Server listening on http://localhost:${port}, Ctrl+C to stop`)})vuex的源码:
https://github.com/vuejs/vuex...
不负相思意
慕妹3146593
随时随地看视频慕课网APP
相关分类