Webpack Loader unable to resolve alias paths #811
Labels
bug report 🦗
Issue is probably a bug, but it needs to be checked
bundler: webpack 📦
Issue is related to webpack bundler
cat: modules aliasing 🔗
Issue related to modules aliasing
cat: performance 🚀
Issue is related to performance
needs: complete repro 🖥️
Issue need to have complete repro provided
Environment
Description
So I am trying to build a UI Library with storybook and for that, I thought of using Linaria. However, after getting started with linaria I ran into this issue of typescript paths not being resolved properly by the linaria-webpack-loader. I am specifically using the @linearia/webpack-loader and not the @linaria/webpack-loader4. Here is the error that I'm getting while I try to import using path alias:
The code:
As for the code, if I change the import from
@UI/core
to../core
then everything works as expected until the next import from@UI
. I also noticed that the first import (@UI/utils
) gets imported without any issues. Maybe because it's just a re-export of thecss
function that is inside the@linaria/core
libraryI also confirm that I can import using the same path alias with other files that are not linked with
@linaria/webpack-loader
The folder structure:
The
tsconfig.json
:The webpack Config at
./.storybook
directoryReproducible Demo
I tried to reproduce a minimal example in code sandbox but the process of setting up webpack and all the loaders related to it was too cumbersome. However here is the link for it.
The text was updated successfully, but these errors were encountered: