Skip to content
GitLab
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
4ad5170b
Commit
4ad5170b
authored
8 years ago
by
Dan Abramov
Committed by
GitHub
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Enable hot reloading for CSS (#42)
parent
ff73f16b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config/webpack.config.dev.js
+4
-1
config/webpack.config.dev.js
scripts/start.js
+1
-0
scripts/start.js
with
5 additions
and
1 deletion
+5
-1
config/webpack.config.dev.js
+
4
-
1
View file @
4ad5170b
...
@@ -20,6 +20,7 @@ module.exports = {
...
@@ -20,6 +20,7 @@ module.exports = {
devtool
:
'
eval
'
,
devtool
:
'
eval
'
,
entry
:
[
entry
:
[
require
.
resolve
(
'
webpack-dev-server/client
'
)
+
'
?http://localhost:3000
'
,
require
.
resolve
(
'
webpack-dev-server/client
'
)
+
'
?http://localhost:3000
'
,
require
.
resolve
(
'
webpack/hot/dev-server
'
),
'
./src/index.js
'
'
./src/index.js
'
],
],
output
:
{
output
:
{
...
@@ -79,6 +80,8 @@ module.exports = {
...
@@ -79,6 +80,8 @@ module.exports = {
inject
:
true
,
inject
:
true
,
template
:
path
.
resolve
(
__dirname
,
relative
,
'
index.html
'
),
template
:
path
.
resolve
(
__dirname
,
relative
,
'
index.html
'
),
}),
}),
new
webpack
.
DefinePlugin
({
'
process.env.NODE_ENV
'
:
'
"development"
'
})
new
webpack
.
DefinePlugin
({
'
process.env.NODE_ENV
'
:
'
"development"
'
}),
// Note: only CSS is currently hot reloaded
new
webpack
.
HotModuleReplacementPlugin
()
]
]
};
};
This diff is collapsed.
Click to expand it.
scripts/start.js
+
1
-
0
View file @
4ad5170b
...
@@ -29,6 +29,7 @@ if (process.argv[2] === '--smoke-test') {
...
@@ -29,6 +29,7 @@ if (process.argv[2] === '--smoke-test') {
new
WebpackDevServer
(
webpack
(
config
,
handleCompile
),
{
new
WebpackDevServer
(
webpack
(
config
,
handleCompile
),
{
publicPath
:
config
.
output
.
publicPath
,
publicPath
:
config
.
output
.
publicPath
,
historyApiFallback
:
true
,
historyApiFallback
:
true
,
hot
:
true
,
// Note: only CSS is currently hot reloaded
stats
:
{
stats
:
{
hash
:
false
,
hash
:
false
,
version
:
false
,
version
:
false
,
...
...
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