Webpack require question?

  node.js, question

clipboard.png

As shown in the figure, every time a file is introduced, it is painful. What can be done to solve the problem. If the file is packaged with a webpack, can you do some configuration in the webpack?
To achieve the following effect.

require('lib/jquery/jquery');
 console.log($.fn.jquery);

Standard answer paper:

Answer: Yes-(2 points)

You can configure aliases for paths. For example, I often like to configure the following-(2 points)
module: {
 resolve: {
 //The next path is relative to the configuration file.
 alias: {
 'components': path.resolve(__dirname, 'components'),
 'apis': path.resolve(__dirname, 'apis'),
 'images': path.resolve(__dirname, 'images'),
 'methods': path.resolve(__dirname, 'method'),
 'fonts': path.resolve(__dirname, 'fonts')
 bracket
 bracket
 bracket