您的位置:首页技术文章
文章详情页

angular.js - /sockjs-node/info?t=1473313213585". [WDS] Disconnected!

【字号: 日期:2024-09-27 13:22:55浏览:32作者:猪猪

问题描述

请问项目运行时总是出现/sockjs-node/info?t=1473313213585'. [WDS] Disconnected!的错误是怎么回事?

webpack.common.js如下

/** * Created by lxy on 2016/8/24. */var webpack = require(’webpack’);var HtmlWebpackPlugin = require(’html-webpack-plugin’);var ExtractTextPlugin = require(’extract-text-webpack-plugin’);var helpers = require(’./helpers’);module.exports = { entry: {’polyfills’: ’./src/polyfills.ts’,’vendor’: ’./src/vendor.ts’,’app’: ’./src/main.ts’,’client’: 'webpack-dev-server/client?http://localhost:8080' }, resolve: {extensions: [’’, ’.js’, ’.ts’,’.html’],modulesDirectories: [ ’node_modules’] }, module: {loaders: [ {test: /.ts$/,loaders: [’ts’, ’angular2-template-loader’] }, {test: /.html$/,loader: ’html’ }, {test: /.(png|jpe?g|gif|svg|woff|woff2|ttf|eot|ico)$/,loader: ’file?name=assets/[name].[hash].[ext]’ }, {test: /.css$/,exclude: helpers.root(’src’, ’app’),loader: ExtractTextPlugin.extract(’style’, ’css?sourceMap’) }, {test: /.css$/,include: helpers.root(’src’, ’app’),loader: ’raw’ }] }, plugins: [new webpack.optimize.CommonsChunkPlugin({ name: [’app’, ’vendor’, ’polyfills’]}),new HtmlWebpackPlugin({ template: ’src/index.html’}) ]};

package.json scripts start 部分:

'start': 'webpack-dev-server --inline --progress --port 8080 --host 0.0.0.0',

angular.js - /sockjs-node/info?t=1473313213585". [WDS] Disconnected!

问题解答

回答1:

webpack-dev-server 加一个 --hot,这个选项是用来配置了更新的。这里是所有的配置项:http://webpack.github.io/docs...

相关文章: