1 line
977 B
Plaintext
1 line
977 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,sBAAT,CACLC,IADK,EAEgC;EACrC,MAAM,CAACC,MAAD,IAAWD,IAAI,CAACE,SAAtB;EAEA,OAAOC,CAAC,CAACC,eAAF,CAAkBH,MAAlB,KAA6BE,CAAC,CAACE,iBAAF,CAAoBJ,MAApB,CAA7B,GACHA,MADG,GAEFK,iBAAA,CAASC,UAAT,CAAoBC,GAAI,QAAOP,MAAO,KAF3C;AAGD"}
|