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
3a42ff90
Commit
3a42ff90
authored
8 years ago
by
Dan Abramov
Committed by
GitHub
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Provide empty Node mocks for fs, net, tls (#672)
parent
cc4aa7be
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/webpack.config.dev.js
+8
-1
config/webpack.config.dev.js
config/webpack.config.prod.js
+8
-1
config/webpack.config.prod.js
with
16 additions
and
2 deletions
+16
-2
config/webpack.config.dev.js
+
8
-
1
View file @
3a42ff90
...
...
@@ -203,5 +203,12 @@ module.exports = {
// makes the discovery automatic so you don't have to restart.
// See https://github.com/facebookincubator/create-react-app/issues/186
new
WatchMissingNodeModulesPlugin
(
paths
.
appNodeModules
)
]
],
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node
:
{
fs
:
'
empty
'
,
net
:
'
empty
'
,
tls
:
'
empty
'
}
};
This diff is collapsed.
Click to expand it.
config/webpack.config.prod.js
+
8
-
1
View file @
3a42ff90
...
...
@@ -238,5 +238,12 @@ module.exports = {
}),
// Note: this won't work without ExtractTextPlugin.extract(..) in `loaders`.
new
ExtractTextPlugin
(
'
static/css/[name].[contenthash:8].css
'
)
]
],
// Some libraries import Node modules but don't use them in the browser.
// Tell Webpack to provide empty mocks for them so importing them works.
node
:
{
fs
:
'
empty
'
,
net
:
'
empty
'
,
tls
:
'
empty
'
}
};
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