webpack-contrib / file-loader

File Loader
MIT License
1.86k stars 257 forks source link

File-Loader not reading from DevServer #335

Closed mperu92 closed 5 years ago

mperu92 commented 5 years ago

Hi, I'm trying to load some fonts using webpack-dev-server, but it seems not reading the correct path. My webpack.config.dev.js:

// ...
                {
                    test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
                    use: [
                    {
                        loader: 'file-loader',
                        options: {
                          limit: 10000,
                          name: '[hash].[ext]',
                          mimetype: 'application/font-woff'
                        }
                    }
                ]
                },
                // font-awesome
                {
                    test: /font-awesome\.config\.js/,
                    use: [
                        { loader: 'style-loader' },
                        { loader: 'font-awesome-loader' }
                    ]
                },
// ...

But when I launch my project the network in Chrome DevTool warns me of few errors: https://localhost:44366/Welcome/af7ae505a9eed503f8b8e6982036873e.woff2 net::ERR_ABORTED 404

but https://localhost:44366/ isn't the webpack-dev-server url, is the url of my IIS Express which hosts the project i'm working for. how can I tell into webpack.config.dev to watch into the webpack-dev-server path and not into the path of my project?

Thank you very much in advance and I apologize for my English!

alexander-akait commented 5 years ago

It looks like you just deleted our lovely crafted issue template. It was there for good reasons. Please help us solving your issue by answering the questions asked in this template. I'm closing this. Please either update the issue with the template and reopen, or open a new issue.

Because you publichPath is wrong, webpack-dev-server doesn't read something from file-loader. Please read docs about publichPath