Enable babel transformer for emotion

Summary: This diff enables the babel transformer for emotion. It is supposed to be a bit faster, but the most interesting thing is that it will show component names inside the dom tree, which, at least for me, will be a huge performance booster is it will make it much easier to find out to which component style changes need to be applied

Reviewed By: nikoant

Differential Revision: D21722021

fbshipit-source-id: cab1278046b1aa7f8b875c016d43dfafdbaa0a2d
This commit is contained in:
Michel Weststrate
2020-05-28 10:12:10 -07:00
committed by Facebook GitHub Bot
parent 54162d480c
commit 828385e246
6 changed files with 70 additions and 66 deletions

View File

@@ -41,12 +41,14 @@ const objectRestSpreadPlugin = require('@babel/plugin-proposal-object-rest-sprea
const flowStripTypesPlugin = require('@babel/plugin-transform-flow-strip-types');
const dynamicRequiresPlugin = require('./dynamic-requires');
const typeScriptPlugin = require('@babel/plugin-transform-typescript');
const emotionPlugin = require('babel-plugin-emotion');
const tsTransformPlugins = [
typeScriptPlugin,
classPropertiesPlugin,
commonJsPlugin,
optionalChainingPlugin,
coalescingOperatorPlugin,
[emotionPlugin, {autoLabel: true}],
];
const jsTransformPlugins = [
commonJsPlugin,
@@ -56,6 +58,7 @@ const jsTransformPlugins = [
optionalChainingPlugin,
coalescingOperatorPlugin,
dynamicRequiresPlugin,
[emotionPlugin, {autoLabel: true}],
];
export default function transform({