 \href{https://github.com/webpack/webpack}{\texttt{  }} 

\href{https://npmjs.com/package/source-map-loader}{\texttt{ }} \href{https://nodejs.org}{\texttt{ }} \href{https://david-dm.org/webpack-contrib/source-map-loader}{\texttt{ }} \href{https://github.com/webpack-contrib/source-map-loader/actions}{\texttt{ }} \href{https://codecov.io/gh/webpack-contrib/source-map-loader}{\texttt{ }} \href{https://gitter.im/webpack/webpack}{\texttt{ }} \href{https://packagephobia.now.sh/result?p=source-map-loader}{\texttt{ }}\hypertarget{md_sfcode_node_modules_source_map_loader_README_autotoc_md28434}{}\doxysection{source-\/map-\/loader}\label{md_sfcode_node_modules_source_map_loader_README_autotoc_md28434}
Extracts source maps from existing source files (from their {\ttfamily source\+Mapping\+URL}).\hypertarget{md_sfcode_node_modules_source_map_loader_README_autotoc_md28435}{}\doxysubsection{Getting Started}\label{md_sfcode_node_modules_source_map_loader_README_autotoc_md28435}
To begin, you\textquotesingle{}ll need to install {\ttfamily source-\/map-\/loader}\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{npm i -\/D source-\/map-\/loader }

\end{DoxyCode}


Then add the plugin to your {\ttfamily webpack} config. For example\+:

{\bfseries{file.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{import css from 'file.css'; }

\end{DoxyCode}


{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  module: \{}
\DoxyCodeLine{    rules: [}
\DoxyCodeLine{      \{}
\DoxyCodeLine{        test: /\(\backslash\).js\$/,}
\DoxyCodeLine{        enforce: 'pre',}
\DoxyCodeLine{        use: ['source-\/map-\/loader'],}
\DoxyCodeLine{      \},}
\DoxyCodeLine{    ],}
\DoxyCodeLine{  \},}
\DoxyCodeLine{\}; }

\end{DoxyCode}


{\ttfamily source-\/map-\/loader} extracts existing source maps from all Java\+Script entries. This includes both inline source maps as well as those linked via URL. All source map data is passed to webpack for processing as per a chosen \href{https://webpack.js.org/configuration/devtool/}{\texttt{ source map style}} specified by the {\ttfamily devtool} option in \href{https://webpack.js.org/configuration/}{\texttt{ webpack.\+config.\+js}}. This loader is especially useful when using 3rd-\/party libraries having their own source maps. If not extracted and processed into the source map of the webpack bundle, browsers may misinterpret source map data. {\ttfamily source-\/map-\/loader} allows webpack to maintain source map data continuity across libraries so ease of debugging is preserved. {\ttfamily source-\/map-\/loader} will extract from any Java\+Script file, including those in the {\ttfamily node\+\_\+modules} directory. Be mindful in setting \href{https://webpack.js.org/configuration/module/\#rule-include}{\texttt{ include}} and \href{https://webpack.js.org/configuration/module/\#rule-exclude}{\texttt{ exclude}} rule conditions to maximize bundling performance.

And run {\ttfamily webpack} via your preferred method.\hypertarget{md_sfcode_node_modules_source_map_loader_README_autotoc_md28436}{}\doxysubsection{Examples}\label{md_sfcode_node_modules_source_map_loader_README_autotoc_md28436}
\hypertarget{md_sfcode_node_modules_source_map_loader_README_autotoc_md28437}{}\doxysubsubsection{Ignoring Warnings}\label{md_sfcode_node_modules_source_map_loader_README_autotoc_md28437}
To ignore warnings, you can use the following configuration\+:

{\bfseries{webpack.\+config.\+js}}


\begin{DoxyCode}{0}
\DoxyCodeLine{module.exports = \{}
\DoxyCodeLine{  module: \{}
\DoxyCodeLine{    rules: [}
\DoxyCodeLine{      \{}
\DoxyCodeLine{        test: /\(\backslash\).js\$/,}
\DoxyCodeLine{        enforce: 'pre',}
\DoxyCodeLine{        use: ['source-\/map-\/loader'],}
\DoxyCodeLine{      \},}
\DoxyCodeLine{    ],}
\DoxyCodeLine{  \},}
\DoxyCodeLine{  stats: \{}
\DoxyCodeLine{    warningsFilter: [/Failed to parse source map/],}
\DoxyCodeLine{  \},}
\DoxyCodeLine{\}; }

\end{DoxyCode}


More information about the {\ttfamily warnings\+Filters} option you can find \href{https://webpack.js.org/configuration/stats/\#statswarningsfilter}{\texttt{ here}};\hypertarget{md_sfcode_node_modules_source_map_loader_README_autotoc_md28438}{}\doxysubsection{Contributing}\label{md_sfcode_node_modules_source_map_loader_README_autotoc_md28438}
Please take a moment to read our contributing guidelines if you haven\textquotesingle{}t yet done so.

./.github/\+CONTRIBUTING.\+md \char`\"{}\+CONTRIBUTING\char`\"{}\hypertarget{md_sfcode_node_modules_source_map_loader_README_autotoc_md28439}{}\doxysubsection{License}\label{md_sfcode_node_modules_source_map_loader_README_autotoc_md28439}
\href{./LICENSE}{\texttt{ MIT}} 