Skip to content

import/no-webpack-loader-syntax Restriction

What it does

Forbid Webpack loader syntax in imports.

Why is this bad?

This loader syntax is non-standard, so it couples the code to Webpack. The recommended way to specify Webpack loader configuration is in a Webpack configuration file.

Example

javascript
import myModule from "my-loader!my-module";
import theme from "style!css!./theme.css";

var myModule = require("my-loader!./my-module");
var theme = require("style!css!./theme.css");

References

Released under the MIT License.