Skip to content

Commit 98474e8

Browse files
Maxim-Filimonovbebraw
authored andcommitted
Changed to raw_loader (webpack#1270)
To avoid confusion with Babel configuration
1 parent 45a89ca commit 98474e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/concepts/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const config = {
8585
},
8686
module: {
8787
rules: [
88-
{test: /\.(js|jsx)$/, use: 'babel-loader'}
88+
{test: /\.txt$/, use: 'raw-loader'}
8989
]
9090
}
9191
};
@@ -95,7 +95,7 @@ module.exports = config;
9595

9696
The configuration above has defined a `rules` property for a single module with two required properties: `test` and `use`. This tells webpack's compiler the following:
9797

98-
> "Hey webpack compiler, when you come across a path that resolves to a '.js' or '.jsx' file inside of a `require()`/`import` statement, **use** the `babel-loader` to transform it before you add it to the bundle".
98+
> "Hey webpack compiler, when you come across a path that resolves to a '.txt' file inside of a `require()`/`import` statement, **use** the `raw-loader` to transform it before you add it to the bundle".
9999
100100
W> It is important to remember when defining rules in your webpack config, you are defining them under `module.rules` and not `rules`. However webpack will yell at you when doing this incorrectly.
101101

@@ -124,7 +124,7 @@ const config = {
124124
},
125125
module: {
126126
rules: [
127-
{test: /\.(js|jsx)$/, use: 'babel-loader'}
127+
{test: /\.txt$/, use: 'raw-loader'}
128128
]
129129
},
130130
plugins: [

0 commit comments

Comments
 (0)