久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術(shù)文章
文章詳情頁

javascript - webpack-dev-server 用node方式報(bào)錯(cuò)

瀏覽:125日期:2023-05-04 11:22:07

問題描述

//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'); });});

javascript - webpack-dev-server 用node方式報(bào)錯(cuò)請問哪里配置錯(cuò)誤了?

問題解答

回答1:

沒有看到devserver的配置啊

標(biāo)簽: JavaScript
相關(guān)文章:
主站蜘蛛池模板: 龙泉市| 卓资县| 连江县| 天津市| 黄山市| 南城县| 长宁区| 锡林郭勒盟| 罗城| 宁津县| 紫云| 桑日县| 临邑县| 和政县| 鹤峰县| 刚察县| 伊川县| 泾阳县| 平潭县| 沾化县| 中超| 休宁县| 常山县| 南雄市| 巴中市| 佛教| 承德县| 武宁县| 铜鼓县| 温州市| 邳州市| 昌江| 拜城县| 定结县| 嘉鱼县| 无为县| 图们市| 肇源县| 攀枝花市| 定安县| 洛宁县|