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
6cc901b9
Commit
6cc901b9
authored
8 years ago
by
Max
Committed by
Christopher Chedeau
8 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Implement index.html to src folder
parent
86bdbf96
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/index.html
+11
-0
src/index.html
webpack.config.dev.js
+4
-1
webpack.config.dev.js
webpack.config.prod.js
+4
-1
webpack.config.prod.js
with
19 additions
and
2 deletions
+19
-2
src/index.html
0 → 100644
+
11
-
0
View file @
6cc901b9
<!doctype html>
<html
lang=
"en"
>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
My React App
</title>
</head>
<body>
<!-- A lot of magic happens in this file. HtmlWebpackPlugin automatically includes all assets (e.g. bundle.js) with the correct HTML tags, which is why they are missing in this HTML file. -->
</body>
</html>
This diff is collapsed.
Click to expand it.
webpack.config.dev.js
+
4
-
1
View file @
6cc901b9
...
...
@@ -74,7 +74,10 @@ module.exports = {
},
plugins
:
[
// TODO: infer from package.json?
new
HtmlWebpackPlugin
({
title
:
'
My React Project
'
}),
new
HtmlWebpackPlugin
({
inject
:
true
,
template
:
path
.
resolve
(
__dirname
,
relative
,
'
src/index.html
'
),
}),
new
webpack
.
DefinePlugin
({
'
process.env.NODE_ENV
'
:
'
"development"
'
})
]
};
This diff is collapsed.
Click to expand it.
webpack.config.prod.js
+
4
-
1
View file @
6cc901b9
...
...
@@ -74,7 +74,10 @@ module.exports = {
},
plugins
:
[
// TODO: infer from package.json?
new
HtmlWebpackPlugin
({
title
:
'
My React Project
'
}),
new
HtmlWebpackPlugin
({
inject
:
true
,
template
:
path
.
resolve
(
__dirname
,
relative
,
'
src/index.html
'
),
}),
new
webpack
.
DefinePlugin
({
'
process.env.NODE_ENV
'
:
'
"production"
'
}),
new
webpack
.
optimize
.
OccurrenceOrderPlugin
(),
new
webpack
.
optimize
.
UglifyJsPlugin
({
compressor
:
{
warnings
:
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
Menu
Explore
Projects
Groups
Snippets