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. spring - mysql中事务是互斥的么?2. python - celery beat 调度如何运行期间动态添加任务?3. python - 多态调用方法时却显示bound method...4. python - django 项目的 migrations 目录是否应该提交到 git5. mysql sql where id in(25,12,87) 结果集如何用按照 25 12 87排序?6. python小白的基础问题 关于while循环的嵌套7. css - 请问B站顶部的模糊半透明导航条是怎么实现的呢?8. mysql索引的疑问9. mysql - 数据库字段命名问题,新人,求解10. (JAVA)最近在做到支付宝的一码多付支付接口,发现没有异步回调通知,需要自己轮询查询订单状态,这个需要怎么实现?

网公网安备