Skip to content

Files

Latest commit

 

History

History
21 lines (15 loc) · 529 Bytes

no-webpack-loader-syntax.md

File metadata and controls

21 lines (15 loc) · 529 Bytes

Pattern: Webpack loader syntax in import

Issue: -

Description

Using Webpack loader syntax directly in import statements couples the code to Webpack. Loader configuration should be specified in the Webpack configuration file instead of the import statement.

Examples

Example of incorrect code:

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

Example of correct code:

import myModule from "./my-module";
import theme from "./theme.css";