升级搜索接口时,遇到问题
来源:10-4 搜索页面suggest组件开发(1)
			慕后端7393567
2019-04-18
var utils = require('./utils')
var webpack = require('webpack')
var config = require('../config')
var merge = require('webpack-merge')
var baseWebpackConfig = require('./webpack.base.conf')
var HtmlWebpackPlugin = require('html-webpack-plugin')
var FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
// add hot-reload related code to entry chunks
Object.keys(baseWebpackConfig.entry).forEach(function (name) {
  baseWebpackConfig.entry[name] = ['./build/dev-client'].concat(baseWebpackConfig.entry[name])
})
module.exports = merge(baseWebpackConfig, {
  module: {
    rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap })
  },
  // cheap-module-eval-source-map is faster for development
  devtool: '#cheap-module-eval-source-map',
  plugins: [
    new webpack.DefinePlugin({
      'process.env': config.dev.env
    }),
    // https://github.com/glenjamin/webpack-hot-middleware#installation--usage
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoEmitOnErrorsPlugin(),
    // https://github.com/ampedandwired/html-webpack-plugin
    new HtmlWebpackPlugin({
      filename: 'index.html',
      template: 'index.html',
      inject: true
    }),
    new FriendlyErrorsPlugin()
  ]
})
老师,这是我的webpack.dev.conf.js文件,对比你升级搜索接口的issue的webpack.dev.conf.js文件差别好大。而且我的项目结构里没有prod.server.js这个文件。求解=。=
写回答
	1回答
- 
				
						ustbhuangyi
2019-04-18
prod.server.js 是后面加的,你只要在 webpack.dev.conf.js 配置路由接口就可以了,参考
https://github.com/ustbhuangyi/vue-music/commit/be096f36922598aa877109c82f238471131254d0022019-04-18 
相似问题