X
X
Xaip2018-07-12 21:25:51
webpack
Xaip, 2018-07-12 21:25:51

Webpack-dev-server not working correctly?

Webpack-dev-server only compiles new problems for me every day, instead of a bundle. At first everything worked fine and he detected all the changes and collected new bundles. But as the project grew, it began to generate problems from scratch. At first he refused to notice the changes and did not update the bundle, then he noticed the updates and even updated the bundle, but still did not display the changes in the browser. Then, in general, I started to take bundles FROM THE PAST COMMIT from somewhere. I'm tired of this.
1) At the moment, it detects changes, builds a bundle, refreshes the browser, but all the same, these changes are not displayed
2) Routing also does not work, that is, routes without nesting like /user, /signup, /detail, etc. work fine, but such routes as /user/message, /detail/1 give an error:

Refused to execute script from 'http://127.0.0.1:3000/user/bundle.js'

Here is the webpack config:
var path = require('path')
var webpack = require('webpack')


module.exports = {
    devServer: {
      historyApiFallback: true,
      inline: true,
      contentBase: 'assets/bundles',
      publicPath: "/user/",
      port: 3000,
    },
    devtool: "cheap-module-eval-source-map",
    entry: ['webpack-dev-server/client?http://127.0.0.1:3000',
        './assets/js/index'],
    
    output: {
        path: __dirname + '/assets/bundles',
        filename: 'bundle.js',
    },
    
    plugins: [
        new webpack.HotModuleReplacementPlugin(),
    ],
    
    module: {
        rules: [
            {
                test:/\.css$/,
                use:['style-loader', 'css-loader']
            },
            {test: /\.jsx?$/,
                exclude: /node_modules/,
                loader: 'babel-loader', 
                query: {
                    presets: ['react'] 
                }
            }
        ]
    },
    
    resolve: {
        modules: ['node_modules'],
        extensions: ['.js', '.jsx'] 
    }   
}

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Igor Pushkarsky, 2014-11-18
Madzhugin @Suntechnic

Hey!
The most important thing I think is to customize DLE, well, it’s very simple here is an example of a site , I don’t know if it’s suitable for a tracker, but I think it can be adapted.

N
NewsPR01, 2017-08-11
@NewsPR01

Look here what dviglo www.hddom.net/news/studija_sojuz/1-0-383

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question