electron-react-boilerplate icon indicating copy to clipboard operation
electron-react-boilerplate copied to clipboard

How to add babelrc

Open roddc opened this issue 3 years ago • 1 comments

Summary

I need to add a babel plugin to my app, I created a babelrc.json in the root folder, but it seems the configurations are not taken. I have to add a babel-loader in the webpack.config.base.ts to make it work. I am not sure this is a good idea to override the webpack config. Here is the config I need to add:

  {
                test: /\.(ts|js)$/,
                exclude: /(node_modules|bower_components)/,
                use: {
                    loader: 'babel-loader',
                    options: {
                        presets: ['@babel/preset-env', '@babel/preset-typescript'],
                        plugins: [
                            'babel-plugin-transform-typescript-metadata',
                            ['@babel/plugin-proposal-decorators', { legacy: true }],
                        ],
                    },
                },
            },

roddc avatar Jul 21 '22 04:07 roddc

Babel isn't supported by ERB. Out of curiosity why do you need babel?

amilajack avatar Aug 15 '22 22:08 amilajack

Babel is needed for anyone wishing to use React Native Reanimated, which is pretty much any any React Native project.

kilbot avatar Jun 09 '23 09:06 kilbot