Sunday, 7 May 2017

Webpack 2 import from subdirectory

In webpack 2, I'd like to be able to specify subdirectories within specific npm packages to be used when importing them.

Example:

// Turn this:
import Module from 'module';

// Into this:
import Module from 'module/dist';

I imagine the resolve section of the config should be able to do what I want but after reading the documentation, I'm still not very clear on how I can achieve the above.



via earthling

No comments:

Post a Comment