Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After upgrade to Webpack beta 23 I can no longer use blank extensions

Tags:

webpack

After I have upgraded to webpack beta 23 I have started getting an error to do with the extensions property when running webpack:

  • configuration.resolve.extensions[0] should not be empty.

my extensions were: extensions: ['','.ts', '.js'],

If I remove the blank extension option the configuration error goes away but now none of my modules will load as they are all loaded without an extension. Is there some specific way I should be specifying blank extension in this new version?

I think I have found the right configuration

I am not sure that this is correct but after a series of trial an error I have tried using the * symbol instead of an empty string. This seems to have fixed the problem.So final syntax for the extensions attribute:

extensions: ['*', 'js', 'ts']

Hope this is the intended way to do it

like image 745
Jusef Avatar asked Sep 22 '16 08:09

Jusef


1 Answers

Just to confirm your findings.

The empty string is deprecated: https://github.com/webpack/webpack/issues/3043

extensions: ['.ts', '.js'] will resolve all of your .ts and .js files, not more.

extensions: ['*', '.ts', '.js'] will resolve all extensions.

like image 172
Robin Wieruch Avatar answered Nov 15 '22 06:11

Robin Wieruch