A Babel 6 plugin that allows using webpack loaders during Babel transpilation, enabling server-side use of CSS modules, image imports, and other webpack loader features without a full webpack build. Version 0.9.0 (last updated 2016) is the current stable release. Maintained primarily for legacy projects; the author strongly recommends migrating to modern alternatives like Jest with moduleNameMapper. Key differentiator: enables isomorphic/universal apps to run on the server without a separate build step. However, it's effectively deprecated in favor of Jest and babel-jest for testing, and Next.js or other frameworks for server-side rendering.
npm install babel-plugin-webpack-loadersVerified import paths — ran on the pinned version, not inferred.
Configure .babelrc with plugin pointing to a webpack config, then import CSS files in Node.js using Babel compilation to get CSS module class names.
Migrate to Jest and mock CSS/asset imports using identity-obj-proxy or similar.
Downgrade webpack to version 2.x or use an alternative like babel-plugin-transform-imports.
Only apply this plugin in Node.js/Babel environments, not in webpack's own configuration.
If using unsupported loaders, consider alternatives like webpack-isomorphic-tools or custom solutions.
Set BABEL_DISABLE_CACHE=1 in your environment before running Babel.
Install via npm: npm install babel-plugin-webpack-loaders --save-dev
Install the missing loaders, e.g., npm install style-loader css-loader --save-dev
Ensure webpack version is exactly ^1.12.9 || ^2.0.0 (i.e., <3.0.0).