Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Meta
create-react-app
Commits
0ac0d116
Commit
0ac0d116
authored
8 years ago
by
Ro Savage
Browse files
Options
Download
Email Patches
Plain Diff
Update comments for webpack loaders
parent
9e0e18fd
1 merge request
!1500
Update comments for loaders webpack to clarify excluding file extensions
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/react-scripts/config/webpack.config.dev.js
+10
-14
packages/react-scripts/config/webpack.config.dev.js
packages/react-scripts/config/webpack.config.prod.js
+10
-12
packages/react-scripts/config/webpack.config.prod.js
with
20 additions
and
26 deletions
+20
-26
packages/react-scripts/config/webpack.config.dev.js
+
10
-
14
View file @
0ac0d116
...
...
@@ -112,20 +112,14 @@ module.exports = {
}
],
loaders
:
[
// Default loader: load all assets that are not handled
// by other loaders with the url loader.
// Note: This list needs to be updated with every change of extensions
// the other loaders match.
// E.g., when adding a loader for a new supported file extension,
// we need to add the supported extension to this loader too.
// Add one new line in `exclude` for each loader.
//
// "file" loader makes sure those assets get served by WebpackDevServer.
// When you `import` an asset, you get its (virtual) filename.
// In production, they would get copied to the `build` folder.
// "url" loader works like "file" loader except that it embeds assets
// smaller than specified limit in bytes as data URLs to avoid requests.
// A missing `test` is equivalent to a match.
// ** ADDING/UPDATING LOADERS **
// The "url" loader handles all assets unless explicitly excluded.
// The `exclude` list *must* be updated with every change to loader extensions.
// When adding a new loader, you must add its `test`
// as a new entry in the `exclude` list for "url" loader.
// "url" loader embeds assets smaller than specified size as data URLs to avoid requests.
// Otherwise, it acts like the "file" loader.
{
exclude
:
[
/
\.
html$/
,
...
...
@@ -179,6 +173,8 @@ module.exports = {
name
:
'
static/media/[name].[hash:8].[ext]
'
}
}
// ** STOP ** Are you adding a new loader?
// Remember to add the new extension(s) to the "url" loader exclusion list.
]
},
// @remove-on-eject-begin
...
...
This diff is collapsed.
Click to expand it.
packages/react-scripts/config/webpack.config.prod.js
+
10
-
12
View file @
0ac0d116
...
...
@@ -120,18 +120,14 @@ module.exports = {
}
],
loaders
:
[
// Default loader: load all assets that are not handled
// by other loaders with the url loader.
// Note: This list needs to be updated with every change of extensions
// the other loaders match.
// E.g., when adding a loader for a new supported file extension,
// we need to add the supported extension to this loader too.
// Add one new line in `exclude` for each loader.
//
// "file" loader makes sure those assets end up in the `build` folder.
// When you `import` an asset, you get its filename.
// "url" loader works just like "file" loader but it also embeds
// assets smaller than specified size as data URLs to avoid requests.
// ** ADDING/UPDATING LOADERS **
// The "url" loader handles all assets unless explicitly excluded.
// The `exclude` list *must* be updated with every change to loader extensions.
// When adding a new loader, you must add its `test`
// as a new entry in the `exclude` list in the "url" loader.
// "url" loader embeds assets smaller than specified size as data URLs to avoid requests.
// Otherwise, it acts like the "file" loader.
{
exclude
:
[
/
\.
html$/
,
...
...
@@ -189,6 +185,8 @@ module.exports = {
name
:
'
static/media/[name].[hash:8].[ext]
'
}
}
// ** STOP ** Are you adding a new loader?
// Remember to add the new extension(s) to the "url" loader exclusion list.
]
},
// @remove-on-eject-begin
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets