admin管理员组文章数量:1287591
Does anyone know how to stop webpack-dev-server? I have tried to use Ctrl+C and Ctrl+Z, it's doesn't work, no matter I press it once or twice. Additionally, even though I close the mand line interface, It still works. And even if I change the server port, the previous server port still works. So I have to change the server port everytime when I close the CLI or want to change some parameters in webpack.config.js.
Here is my webpack.config.js:
const path = require('path');
const HtmlWebpackPlugin = require("html-webpack-plugin");
const webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: {
main: './src/main.js'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
},
devtool: false,
module: {
rules: [{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader"
})},{
test: /\.(js|jsx)?$/,
use: ['babel-loader'],
exclude: /node_modules/
}]
},
devServer: {
contentBase: './dist',
hot: true,
port: 8088,
},
plugins: [
new HtmlWebpackPlugin({
title: "Hello React",
template: "template.html",
}),
new webpack.HotModuleReplacementPlugin(),
new ExtractTextPlugin("style.bundle.css")
]
};
Does anyone know how to stop webpack-dev-server? I have tried to use Ctrl+C and Ctrl+Z, it's doesn't work, no matter I press it once or twice. Additionally, even though I close the mand line interface, It still works. And even if I change the server port, the previous server port still works. So I have to change the server port everytime when I close the CLI or want to change some parameters in webpack.config.js.
Here is my webpack.config.js:
const path = require('path');
const HtmlWebpackPlugin = require("html-webpack-plugin");
const webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
module.exports = {
entry: {
main: './src/main.js'
},
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'bundle.js',
},
devtool: false,
module: {
rules: [{
test: /\.css$/,
use: ExtractTextPlugin.extract({
fallback: "style-loader",
use: "css-loader"
})},{
test: /\.(js|jsx)?$/,
use: ['babel-loader'],
exclude: /node_modules/
}]
},
devServer: {
contentBase: './dist',
hot: true,
port: 8088,
},
plugins: [
new HtmlWebpackPlugin({
title: "Hello React",
template: "template.html",
}),
new webpack.HotModuleReplacementPlugin(),
new ExtractTextPlugin("style.bundle.css")
]
};
And here is my package.json
{
"name": "react-test",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build": "webpack --config webpack.config.js",
"start": "webpack-dev-server --config webpack.config.js",
"produce": "webpack -p --config webpack.config.js"
},
"author": "dongxu <[email protected]>",
"license": "ISC",
"devDependencies": {
"babel-core": "^6.25.0",
"babel-loader": "^7.1.1",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"css-loader": "^0.28.4",
"html-webpack-plugin": "^2.29.0",
"react": "^15.6.1",
"react-dom": "^15.6.1",
"react-hot-loader": "^1.3.1",
"style-loader": "^0.18.2",
"webpack": "^3.4.1",
"webpack-dev-server": "^2.6.1"
}
}
Addtionally, there is my console window: enter image description here
As you see, I have pressed Ctrl + C twice, subsequently, I changed the content of file, the webpack-dev-server piles again, and I can still see the content by refresh my browser.
Share Improve this question edited Jul 31, 2017 at 7:03 DongShelton asked Jul 31, 2017 at 1:30 DongSheltonDongShelton 531 gold badge1 silver badge5 bronze badges 3- 1 I've used Ctrl+C to stop it on every platform I've been on without fail. There must be something else going on – rossipedia Commented Jul 31, 2017 at 2:23
- Can you post a screenshot of your console when you try to use Ctrl + C? – FuriousD Commented Jul 31, 2017 at 3:54
- does pressing 'q' helps? – manish kumar Commented Jul 31, 2017 at 7:04
4 Answers
Reset to default 2If you know the name of the process, you can use the mand to kill the process. I just use "Ctrl + c" twice ,stop the webpack-dev-server
On Linux, try Ctrl+\.
For me Ctrl+C while piling does work but takes many seconds to die (and keeps spewing progress %), while Ctrl+\ makes webpack-dev-server (3.10.1) shut up immediately
本文标签: javascriptHow can I stop webpackdevserverStack Overflow
版权声明:本文标题:javascript - How can I stop webpack-dev-server - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741311052a2371652.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论