UNPKG

1.61 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = _default;
7var _pluginSyntaxJsx = _interopRequireDefault(require("@babel/plugin-syntax-jsx"));
8var _pure = _interopRequireDefault(require("./visitors/pure"));
9var _minify = _interopRequireDefault(require("./visitors/minify"));
10var _displayNameAndId = _interopRequireDefault(require("./visitors/displayNameAndId"));
11var _templateLiterals = _interopRequireDefault(require("./visitors/templateLiterals"));
12var _assignStyledRequired = _interopRequireDefault(require("./visitors/assignStyledRequired"));
13var _transpileCssProp = _interopRequireDefault(require("./visitors/transpileCssProp"));
14function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15function _default({
16 types: t
17}) {
18 return {
19 inherits: _pluginSyntaxJsx.default,
20 visitor: {
21 Program(path, state) {
22 path.traverse({
23 JSXAttribute(path, state) {
24 (0, _transpileCssProp.default)(t)(path, state);
25 },
26 VariableDeclarator(path, state) {
27 (0, _assignStyledRequired.default)(t)(path, state);
28 }
29 }, state);
30 },
31 CallExpression(path, state) {
32 (0, _displayNameAndId.default)(t)(path, state);
33 (0, _pure.default)(t)(path, state);
34 },
35 TaggedTemplateExpression(path, state) {
36 (0, _minify.default)(t)(path, state);
37 (0, _displayNameAndId.default)(t)(path, state);
38 (0, _templateLiterals.default)(t)(path, state);
39 (0, _pure.default)(t)(path, state);
40 }
41 }
42 };
43}
\No newline at end of file