Answer the question
In order to leave comments, you need to log in
Why doesn't webpack-dev-server update when stylus files change?
Good afternoon! I am writing a simple webpack react config
const webpack = require('webpack');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const WebpackNotifierPlugin = require('webpack-notifier');
const config = {
entry: [
"./_f/app.js"
],
output: {
path: __dirname + "/_p",
filename: "st.js"
},
devServer: {
contentBase: "./_p",
historyApiFallback: true,
inline: true,
port: 2000
},
module: {
rules: [
{
test: /\.(js)$/,
exclude: /node_modules/,
loader: 'babel-loader',
options: {
presets: ['es2015', 'react']
}
},
{
test: /\.styl/,
exclude: /node_modules/,
use: ExtractTextPlugin.extract({
fallback: 'style-loader',
use: [
{
loader: 'css-loader',
options: {
sourceMap: true,
minimize: true
}
}, 'autoprefixer-loader?browsers=last 2 versions', 'stylus-loader']
})
}
],
},
plugins: [
new ExtractTextPlugin('st.css'),
new WebpackNotifierPlugin,
new webpack.HotModuleReplacementPlugin()
],
devtool: "cheap-inline-module-source-map",
}
module.exports = config;
Answer the question
In order to leave comments, you need to log in
After a day of manipulation, I did it differently, removed --hot
"scripts": {
"start": "webpack-dev-server --hot"
},
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question