Babel plugin to transpile {\ttfamily import()} to a deferred {\ttfamily require()}, for node. Matches the \href{https://github.com/domenic/proposal-import-function}{\texttt{ proposed spec}}.

{\bfseries{NOTE\+:}} Babylon $>$= v6.\+12.\+0 is required to correctly parse dynamic imports.\hypertarget{md_sfcode_node_modules_babel_plugin_dynamic_import_node_README_autotoc_md3785}{}\doxysection{Installation}\label{md_sfcode_node_modules_babel_plugin_dynamic_import_node_README_autotoc_md3785}

\begin{DoxyCode}{0}
\DoxyCodeLine{npm install babel-\/plugin-\/dynamic-\/import-\/node -\/-\/save-\/dev }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_babel_plugin_dynamic_import_node_README_autotoc_md3786}{}\doxysection{Usage}\label{md_sfcode_node_modules_babel_plugin_dynamic_import_node_README_autotoc_md3786}
\hypertarget{md_sfcode_node_modules_babel_plugin_dynamic_import_node_README_autotoc_md3787}{}\doxysubsection{Via $<$tt$>$.\+babelrc$<$/tt$>$ (\+Recommended)}\label{md_sfcode_node_modules_babel_plugin_dynamic_import_node_README_autotoc_md3787}
$\ast$$\ast$.babelrc$\ast$$\ast$


\begin{DoxyCode}{0}
\DoxyCodeLine{\{}
\DoxyCodeLine{  "{}plugins"{}: ["{}dynamic-\/import-\/node"{}]}
\DoxyCodeLine{\} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_babel_plugin_dynamic_import_node_README_autotoc_md3788}{}\doxysubsubsection{Options}\label{md_sfcode_node_modules_babel_plugin_dynamic_import_node_README_autotoc_md3788}

\begin{DoxyItemize}
\item $\ast${\ttfamily no\+Interop}$\ast$ -\/ A boolean value, that if true will not interop the require calls. Useful to avoid using `require(\textquotesingle{}module').default\`{} on commonjs modules.
\end{DoxyItemize}


\begin{DoxyCode}{0}
\DoxyCodeLine{\{}
\DoxyCodeLine{  "{}plugins"{}: [}
\DoxyCodeLine{    ["{}dynamic-\/import-\/node"{}, \{ "{}noInterop"{}: true \}]}
\DoxyCodeLine{  ]}
\DoxyCodeLine{\} }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_babel_plugin_dynamic_import_node_README_autotoc_md3789}{}\doxysubsection{Via CLI}\label{md_sfcode_node_modules_babel_plugin_dynamic_import_node_README_autotoc_md3789}

\begin{DoxyCode}{0}
\DoxyCodeLine{\$ babel -\/-\/plugins dynamic-\/import-\/node script.js }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_babel_plugin_dynamic_import_node_README_autotoc_md3790}{}\doxysubsection{Via Node API}\label{md_sfcode_node_modules_babel_plugin_dynamic_import_node_README_autotoc_md3790}

\begin{DoxyCode}{0}
\DoxyCodeLine{require('babel-\/core').transform('code', \{}
\DoxyCodeLine{  plugins: ['dynamic-\/import-\/node']}
\DoxyCodeLine{\}); }

\end{DoxyCode}
\hypertarget{md_sfcode_node_modules_babel_plugin_dynamic_import_node_README_autotoc_md3791}{}\doxysubsection{Code Example}\label{md_sfcode_node_modules_babel_plugin_dynamic_import_node_README_autotoc_md3791}

\begin{DoxyCode}{0}
\DoxyCodeLine{Promise.all([}
\DoxyCodeLine{  import('./lib/import1'),}
\DoxyCodeLine{  import('./lib/import2')}
\DoxyCodeLine{ ]).then(([}
\DoxyCodeLine{   Import1,}
\DoxyCodeLine{   Import2}
\DoxyCodeLine{  ]) => \{}
\DoxyCodeLine{   console.log(Import1);}
\DoxyCodeLine{   /* CODE HERE*/}
\DoxyCodeLine{  \}); }

\end{DoxyCode}
 