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. dockerfile - [docker build image失败- npm install]2. javascript - vue生成一维码?求助!!!!!急3. javascript - 修改表单多选项时和后台同事配合的问题。4. angular.js - angularjs 怎么封装 upload 上传5. mysql - 索引过滤性不好是由什么原因引起的,应该怎么解决6. 网页爬虫 - Python:爬虫的中文编码问题?7. android - Listview模仿朋友圈点赞的TextView没有刷新?8. docker内创建jenkins访问另一个容器下的服务器问题9. tornado - python使用yield是否能保证协程的顺序性?10. javascript - H5页面怎么查看console信息?
