1 line
983 B
Plaintext
1 line
983 B
Plaintext
{"version":3,"names":["getDynamicImportSource","node","source","arguments","t","isStringLiteral","isTemplateLiteral","template","expression","ast"],"sources":["../src/dynamic-import.ts"],"sourcesContent":["// Heavily inspired by\n// https://github.com/airbnb/babel-plugin-dynamic-import-node/blob/master/src/utils.js\n\nimport * as t from \"@babel/types\";\nimport template from \"@babel/template\";\n\nexport function getDynamicImportSource(\n node: t.CallExpression,\n): t.StringLiteral | t.TemplateLiteral {\n const [source] = node.arguments;\n\n return t.isStringLiteral(source) || t.isTemplateLiteral(source)\n ? source\n : (template.expression.ast`\\`\\${${source}}\\`` as t.TemplateLiteral);\n}\n"],"mappings":";;;;;;AAGA;AACA;;AAEO,SAASA,sBAAsB,CACpCC,IAAsB,EACe;EACrC,MAAM,CAACC,MAAM,CAAC,GAAGD,IAAI,CAACE,SAAS;EAE/B,OAAOC,CAAC,CAACC,eAAe,CAACH,MAAM,CAAC,IAAIE,CAAC,CAACE,iBAAiB,CAACJ,MAAM,CAAC,GAC3DA,MAAM,GACLK,iBAAQ,CAACC,UAAU,CAACC,GAAI,QAAOP,MAAO,KAA0B;AACvE"} |