Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 140071

Webpack4 serve files with different path name

$
0
0

I am running localhost:3042. My files are serving in network tab like this:

enter image description here

But I have to serve the URL like: http://localhost:3042/dual/main.27678bfec444f64cd7ab.js

I am using mod_proxy to serve this project files to other projects. Another project URL like http://localhost:3030/dual. but it needs files to serve from http://localhost:3042/dual/main.27678bfec444f64cd7ab.js but currently, it serves http://localhost:3042/main.27678bfec444f64cd7ab.js, so getting 400.

I have tried with webpack devserver as shown below:

devServer: {
        port: 3042,
        historyApiFallback: true,
        publicPath: '/',
        proxy: {
            '/dual': {
                target: 'http://localhost:[port]/',
                pathRewrite: { '^/dual': '' },
            },
        },
    },

but it won`t work, any help on how to do this?


Viewing all articles
Browse latest Browse all 140071

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>