javascript - webpack-dev-server 用node方式报错
问题描述
//webpack.config.jsmodule.exports = { resolve:{ alias: { common: path.resolve(__dirname, ’../src/_common’), node_modules: path.resolve(__dirname, ’../node_modules’) } }, module:{ rules:[ {test:/.(js|jsx)$/,loader:’babel-loader’,exclude:/node_modules/,query: { presets: [’es2015’,’stage-0’]} } ] }};
//devConfig.jsmodule.exports = { entry: [ ’webpack-dev-server/client?http://localhost:8080’, ’webpack/hot/dev-server’, path.resolve(__dirname, ’../src/demo/index.js’) ], output: { filename: 'bundle.js', publicPath: ’http://localhost:8080/assets/’ }, devtool:’eval-source-map’, module: { rules: [{ test:/.scss$/, use: ['css-loader?-autoprefixer&sourceMap', ’postcss-loader’, 'sass-loader']} ] }, plugins: [ new webpack.DefinePlugin({’process.env.NODE_ENV’: ’'development'’ }), new webpack.HotModuleReplacementPlugin(), new OpenBrowserPlugin({}), new HtmlWebpackPlugin({title: ’demo’,filename: ’demo/index.html’,inject: true,chunks: [’demo/index’],template: path.resolve(__dirname, ’../src/demo/index.html’) }) ] }
gulp.task(’dev’,() => { let optionConfig = merge(webpackconfig, devConfig); const myDevConfig = Object.create(optionConfig); new webpackDevServer(webpack(myDevConfig), { stats: { colors: true }, publicPath: devConfig([’demo’]).output.publicPath, historyApiFallback: true, hot: true, watchOptions: { poll: true, watch: true }, watchContentBase: true }).listen(8080, 'localhost', function(err) { if(err) throw new gutil.PluginError('webpack-dev-server', err); gutil.log('[webpack-dev-server]', 'http://localhost:8080/webpack-dev-server/index.html'); });});
请问哪里配置错误了?
问题解答
回答1:没有看到devserver的配置啊
相关文章:
1. javascript - echart+百度地图2. javascript 开发百度地图3. nginx - 关于vue项目部署到ngnix后出现的问题4. 如图的flex骰子布局是怎么实现的?5. java中这四个注解有什么区别啊?项目中怎么都是混用?6. angular.js - 百度爬虫如何处理“#”符号?7. nosql - mongodb 多组数据不固定字段查询问题 [百度党请绕道]8. javascript - 前端开发中业务模型和视图模型具体分别指什么?9. html - 使用CkEditor时,在后台(php)无法接收到文本域中的内容???10. javascript - 请问div是个链接,鼠标移上去能出现一个div,比如查看更多按钮,怎么做?
