Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Native Webpack 5 functionality #23

Open
dobromir-hristov opened this issue Oct 18, 2022 · 0 comments
Open

Native Webpack 5 functionality #23

dobromir-hristov opened this issue Oct 18, 2022 · 0 comments

Comments

@dobromir-hristov
Copy link

Leaving this for ppl who stumble into this package, but wondering how to make it work for Webpack 5:

Webpack 5 has a native functionality that does the main thing this package was intended to do, fallback across folders to find a file, using an alias.

https://webpack.js.org/configuration/resolve/#resolvealias

module.exports = {
  //...
  resolve: {
    alias: {
      _: [ // note the array here
        path.resolve(__dirname, 'src/utilities/'),
        path.resolve(__dirname, 'src/templates/'),
      ],
    },
  },
};
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant