responsive-loader icon indicating copy to clipboard operation
responsive-loader copied to clipboard

outputPath is not respecting absolute paths

Open Trinovantes opened this issue 4 years ago • 0 comments

I'm using version 3.0.0-2

export default {
    output: {
        path: '/dist/public',
        publicPath: '/public/'
    }
    
    module: {
        rules: [
            {
                test: /\.(jpe?g|png|gif|webp)$/i,
                use: [
                    {
                        loader: 'responsive-loader',
                        options: {
                            // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
                            adapter: require('responsive-loader/sharp'),
                            esModule: false,
                            outputPath: '/dist/img/',
                            publicPath: '/img/',
                            cacheDirectory: true,
                        },
                    },
                ],
            },
        ],
    },
}

This causes the images to be saved to /dist/public/dist/img/ instead of /dist/img

Trinovantes avatar Jul 18 '21 06:07 Trinovantes