You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example new props isStatic: boolean - this import can changes or it static string staticSpecifier: string or specifier: string - if isStatic: true it can be useful
My case for this props, i write small webpack loader for add some query params(?foo=bar) to some imports(doesn't matter static or dynamic)
Currently code that i use
const removeComments = text => text
.replace(/\/\*.*\*\//gm, '')
.replace(/\/\/.*\n/gm, '');
const isStaticDynamicImport = (expression) => {
const normalized = removeComments(expression);
return (normalized.startsWith('\'') && normalized.endsWith('\''))
|| (normalized.startsWith('"') && normalized.endsWith('"'));
};
// Not very stable i think
const getStaticSpecifier = (expression) =>
removeComments(expression).slice(1, -1);
The text was updated successfully, but these errors were encountered:
Hi dear @Kolobok12309 indeed it is sometimes handy to have more information off the import/exorts. Unfrounatly currently it is hard as we rely on Regex based parser.
With #219, we might be able to do that. I am closing this issue to track from single place. BTW thanks for suggestion 👍🏼
For example new props
isStatic: boolean
- this import can changes or it static stringstaticSpecifier: string
orspecifier: string
- ifisStatic: true
it can be usefulMy case for this props, i write small webpack loader for add some query params(
?foo=bar
) to some imports(doesn't matter static or dynamic)Currently code that i use
The text was updated successfully, but these errors were encountered: