1 | import _extends from '@babel/runtime/helpers/esm/extends';
|
2 | import _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';
|
3 | import jsx from '@babel/plugin-transform-react-jsx';
|
4 | import pragmatic from '@emotion/babel-plugin-jsx-pragmatic';
|
5 | import emotion from '@emotion/babel-plugin';
|
6 |
|
7 | var _excluded = ["pragma", "sourceMap", "autoLabel", "labelFormat", "importMap"];
|
8 | var pragmaName = '___EmotionJSX';
|
9 |
|
10 |
|
11 |
|
12 |
|
13 | var index = (function (api, _temp) {
|
14 | var _ref = _temp === void 0 ? {} : _temp;
|
15 | _ref.pragma;
|
16 | var sourceMap = _ref.sourceMap,
|
17 | autoLabel = _ref.autoLabel,
|
18 | labelFormat = _ref.labelFormat,
|
19 | importMap = _ref.importMap,
|
20 | options = _objectWithoutPropertiesLoose(_ref, _excluded);
|
21 |
|
22 | if (options.runtime) {
|
23 | throw new Error('The `runtime` option has been removed. If you want to configure `runtime: "automatic"`, replace `@emotion/babel-preset-css-prop` with `@babel/preset-react` and `@emotion/babel-plugin`. You can find out how to configure things properly here: https://emotion.sh/docs/css-prop#babel-preset');
|
24 | }
|
25 |
|
26 | return {
|
27 | plugins: [[pragmatic, {
|
28 | "export": 'jsx',
|
29 | module: '@emotion/react',
|
30 | "import": pragmaName
|
31 | }], [jsx, _extends({
|
32 | pragma: pragmaName,
|
33 | pragmaFrag: 'React.Fragment'
|
34 | }, options)], [emotion, {
|
35 | sourceMap: sourceMap,
|
36 | autoLabel: autoLabel,
|
37 | labelFormat: labelFormat,
|
38 | cssPropOptimization: true,
|
39 | importMap: importMap
|
40 | }]]
|
41 | };
|
42 | });
|
43 |
|
44 | export { index as default };
|