callstack / linaria

Zero-runtime CSS in JS library
https://linaria.dev
MIT License
11.5k stars 414 forks source link

Document module-resolver warning #1363

Open PierreGUI opened 11 months ago

PierreGUI commented 11 months ago

Environment

Description

I'm getting the warning even though I added the plugin to my config.

[linaria] path/Onboarding.tsx has a module-resolver plugin in its babelrc, but it is not present in the babelOptions for the linaria plugin. This works for now but will be an error in the future. Please add the module-resolver plugin to the babelOptions for the linaria plugin.

.babelrc

...
"plugins": [
    ["module-resolver", { "alias": { "~": "./src" }}]

webpack.config.js

...
use: [
    'babel-loader',
    {
        loader: '@linaria/webpack5-loader',
        options: {
            babelOptions: {
                plugins: [
                    ["module-resolver", { "alias": { "~": "./src" }}],
                ],
            },
        },
    },
],

What am I doing wrong?

Anber commented 11 months ago

It may be related to https://github.com/callstack/linaria/pull/1361. Have you checked it with @linaria/babel-preset 5.0.3?

PierreGUI commented 11 months ago

Yes that's the version I use

Anber commented 11 months ago

And that's bad news :)