webpack-contrib / file-loader

File Loader
MIT License
1.86k stars 257 forks source link

prepending a hostname to the name option of file loader breaks compilation #280

Closed ghost closed 6 years ago

ghost commented 6 years ago

Bug report

What is the current behavior?

build compilation does not work :

 λ npm run build

> typescript-sass-modules@0.1.0 build C:\Users\cypri\projets\typescript-sass-modules-boilerplate
> node scripts/build.js

Creating an optimized production build...
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
ts-loader: Using typescript@2.8.1 and C:\Users\cypri\projets\typescript-sass-modules-boilerplate\tsconfig.json
No valid rules have been specified 

stuck here.

If the current behavior is a bug, please provide the steps to reproduce.

add a file loader to a webpack.config.prod.js like following:

{ loader: require.resolve('file-loader'), exclude: [/\.js$/, /\.html$/, /\.json$/], options: { name: 'http://test-vad/build/static/media/[name].[hash:8].[ext]', }, },

What is the expected behavior?

build works, hostname prepended to files urls

I can provide an example repo tomorrow Other relevant information: webpack version: 3.8.1 Node.js version: 8.11.2 Operating System: win10 Additional tools:

ghost commented 6 years ago

issue resolved by setting PUBLIC_URL to .env, instend of changing file loader name option