Skip to content

Commit e6d6821

Browse files
committed
fix: webpack settings was causing issues
1 parent 527aeeb commit e6d6821

File tree

6 files changed

+55
-24
lines changed

6 files changed

+55
-24
lines changed

config/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const config = {
1818
},
1919
plugins: [
2020
new HtmlWebpackPlugin({
21-
template: path.resolve(__dirname, '../src/index.html')
21+
template: path.join(SRC_DIRECTORY, 'index.html')
2222
}),
2323
new CopyWebpackPlugin([
2424
{ from: path.join(SRC_DIRECTORY, 'assets'), to: path.join(ROOT_DIRECTORY, 'build') }

config/webpack.config.production.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const config = require('./webpack.config.js');
2+
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
23

34
config.mode = 'production';
45

@@ -8,4 +9,11 @@ config.optimization = {
89
}
910
};
1011

12+
config.plugins = config.plugins.concat([
13+
new UglifyJsPlugin({
14+
sourceMap: true,
15+
extractComments: true
16+
})
17+
]);
18+
1119
module.exports = config;

package-lock.json

Lines changed: 43 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"watch:style": "node-sass --watch src/assets/styles/index.scss build/index.css",
1313
"sass": "node-sass src/styles/index.scss build/index.css",
1414
"build": "npm run clean && npm run sass && npm run webpack",
15-
"heroku-postbuild": "webpack --config config/webpack.config.production.js",
15+
"heroku-postbuild": "npm run --config config/webpack.config.production.js",
1616
"lint": "eslint src config",
1717
"dev": " webpack-dashboard -- webpack-dev-server --config config/webpack.config.dev.js",
1818
"test": "export NODE_ENV=test && jest",

src/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="utf-8">
55
<title>React Webpack Babel Starter Kit</title>
66
<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' />
7-
<link rel="stylesheet" type="text/css" href="index.css" />
7+
<link rel="stylesheet" type="text/css" href="/build/index.css" />
88
<link rel="icon" type="image/png" sizes="24x24" href="/icons/favicon-32x32.png">
99
<link rel="shortcut icon" sizes="192x192" href="/icons/shortcut-192x192.png" type="image/png">
1010
<link rel="apple-touch-icon" sizes="192x192" href="/icons/shortcut-192x192.png" type="image/png">

src/styles/base/_reset.sass

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
/* http://meyerweb.com/eric/tools/css/reset/
2-
v2.0 | 20110126
3-
License: none (public domain) */
4-
51
html, body, div, span, applet, object, iframe,
62
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
73
a, abbr, acronym, address, big, cite, code,
@@ -58,4 +54,4 @@ a
5854

5955

6056
html
61-
font-family: sans-serif
57+
font-family: sans-serif

0 commit comments

Comments
 (0)