lahmatiy/component-inspector

Invalid path to file on windows platform.

Mavrin opened this issue · 3 comments

image

Do you have any idea how we can fix it?

I found decision. I set rewrite rules for path to file.

Could you share how rule looks?

I use express for server api and generating html pages and webpack devserver in develompent mode for assets.
I have next files structure and I run server from app folder
image

The rule looks like:

var server = new WebpackDevServer(compiler, {
    ...
    proxy: {
        '*public/js/*': {
            target: pathToTargetServer,
            rewrite: function(req) {
                req.url = req.url.replace(/.+public\//, '');
            }
        },
        '*': pathToTargetServer
    },
    publicPath: '/assets/',
    setup(app) {
        app.use(openInEditor());
    }
});