linaria icon indicating copy to clipboard operation
linaria copied to clipboard

Document module-resolver warning

Open PierreGUI opened this issue 1 year ago • 3 comments

Environment

  • Linaria version: 5.0.2
  • Bundler (+ version): Webpack 5 (loader 5.0.3)
  • Node.js version: 16.14.2
  • OS: Mac OSX

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?

PierreGUI avatar Sep 28 '23 17:09 PierreGUI

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

Anber avatar Sep 29 '23 07:09 Anber

Yes that's the version I use

PierreGUI avatar Sep 29 '23 08:09 PierreGUI

And that's bad news :)

Anber avatar Sep 29 '23 09:09 Anber