Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any idea why I need a babel.config.js file and a .babelrc? #170

Open
schester44 opened this issue Feb 1, 2020 · 1 comment
Open

Any idea why I need a babel.config.js file and a .babelrc? #170

schester44 opened this issue Feb 1, 2020 · 1 comment

Comments

@schester44
Copy link

Using backpack in a monorepo with a common shared folder.

folder structure is like this:

project1/
    .babelrc
project2/
    .babelrc
shared

Both project1 and project2 have their own backpack config. I'm using babel's module-resolver plugin to resolve the shared folder so I can do stuff like import db from 'shared/db'.

All of this works fine but I get errors indicating babel isn't transpiling the code located in shared. Weirdly enough, copying the .babelrc contents to a babel.config.js fille work as intended.

Here is my .babelrc:


module.exports = {
	presets: ['backpack-core/babel'],
	plugins: [
		'date-fns',
		'@babel/plugin-proposal-nullish-coalescing-operator',
		'@babel/plugin-proposal-optional-chaining',
		[
			'module-resolver',
			{
				root: ['./src'],
				alias: {
					shared: '../shared'
				}
			}
		]
	]
}

Any idea what i'm doing wrong here?

@p21nc3
Copy link

p21nc3 commented Apr 5, 2023

Hi schester44,

Are you still facing this issue? (babel.config.js file and a .babelrc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants