Altiano Gerung
Altiano Gerung

Reputation: 854

Webpack - chunk won't loaded

i have a problem with webpack chunks

so i configure webpack to compile to dist folder then there is buldle.js and 1.bundle.js there

but 1.bundle.js won't be retrived by the browser because the path to the file is wrong

in chrome devtool > network tab

bundle.js = http://localhost:3000/dist/bundle.js

but.. 1.bundle.js = http://localhost:3000/1.bundle.js

what is wrong?

Upvotes: 0

Views: 553

Answers (1)

Altiano Gerung
Altiano Gerung

Reputation: 854

I found the answer, we need to specify publicPath .. Webpack not loading partial files from the same root

{
    entry: 'src/main.js',
    output: {
        path: 'dist/',
        publicPath: '/dist/'
    }
}

Upvotes: 2

Related Questions