Skip to content

Commit

Permalink
set optimization using webpack option
Browse files Browse the repository at this point in the history
Rate limit · GitHub

Access has been restricted

You have triggered a rate limit.

Please wait a few minutes before you try again;
in some cases this may take up to an hour.

HyunMo Ahn committed Apr 21, 2019
1 parent bf8cf8d commit c2e6ea1
Showing 5 changed files with 39 additions and 40 deletions.
2 changes: 0 additions & 2 deletions app/renderer/pages/widget/widget.html
Original file line number Diff line number Diff line change
@@ -10,8 +10,6 @@
</head>
<body>
<div id="root"></div>
<!--fontawesome CDN-->
<script defer src="https://use.fontawesome.com/releases/v5.0.2/js/all.js"></script>
<!-- inject bundle.js in webpack-dev-server when NODE_ENV is development -->
<script>
const scripts = [];
11 changes: 5 additions & 6 deletions config/webpack/webpack.basic.config.js
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ module.exports = {
configFile: path.join(CONFIG_PATH, '.eslintrc'),
},
},
]
],
},
{
test: /\.s?css$/,
@@ -49,8 +49,8 @@ module.exports = {
path.join(APP_PATH, 'renderer/scss', '**/_*.scss'),
],
},
}
]
},
],
},
{
test: /\.(png|jpg|jpeg|gif|woff|woff2|ttf|eot|cur)$/,
@@ -64,10 +64,9 @@ module.exports = {
{
test: /\.svg$/,
loader: 'raw-loader',
}
]
},
],
},

plugins: [
new HtmlWebpackPlugin({
chunks: ['widget'],
7 changes: 7 additions & 0 deletions config/webpack/webpack.prod.config.js
Original file line number Diff line number Diff line change
@@ -10,4 +10,11 @@ module.exports = webpackMerge(webpackBaseConfig, {
publicPath: './',
},
mode: 'production',
optimization: {
splitChunks: {
chunks (chunk) {
return chunk.name !== 'preloadScript';
},
},
},
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -95,7 +95,7 @@
"electron-updater": "^3.0.3",
"flux-standard-action": "^2.0.3",
"hoist-non-react-statics": "^2.5.5",
"html-webpack-plugin": "^3.2.0",
"html-webpack-plugin": "^4.0.0-beta.5",
"immutable": "^3.8.2",
"is-url": "^1.2.4",
"menubar": "^5.2.3",
57 changes: 26 additions & 31 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -4586,9 +4586,10 @@ hash.js@^1.0.0, hash.js@^1.0.3:
inherits "^2.0.3"
minimalistic-assert "^1.0.1"

he@1.1.x:
version "1.1.1"
resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"
he@1.2.x:
version "1.2.0"
resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==

history@^4.7.2:
version "4.7.2"
@@ -4660,28 +4661,29 @@ html-entities@^1.2.0:
version "1.2.1"
resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-1.2.1.tgz#0df29351f0721163515dfb9e5543e5f6eed5162f"

html-minifier@^3.2.3:
version "3.5.20"
resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.20.tgz#7b19fd3caa0cb79f7cde5ee5c3abdf8ecaa6bb14"
html-minifier@^3.5.20:
version "3.5.21"
resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.21.tgz#d0040e054730e354db008463593194015212d20c"
integrity sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA==
dependencies:
camel-case "3.0.x"
clean-css "4.2.x"
commander "2.17.x"
he "1.1.x"
he "1.2.x"
param-case "2.1.x"
relateurl "0.2.x"
uglify-js "3.4.x"

html-webpack-plugin@^3.2.0:
version "3.2.0"
resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-3.2.0.tgz#b01abbd723acaaa7b37b6af4492ebda03d9dd37b"
html-webpack-plugin@^4.0.0-beta.5:
version "4.0.0-beta.5"
resolved "https://registry.yarnpkg.com/html-webpack-plugin/-/html-webpack-plugin-4.0.0-beta.5.tgz#2c53083c1151bfec20479b1f8aaf0039e77b5513"
integrity sha512-y5l4lGxOW3pz3xBTFdfB9rnnrWRPVxlAhX6nrBYIcW+2k2zC3mSp/3DxlWVCMBfnO6UAnoF8OcFn0IMy6kaKAQ==
dependencies:
html-minifier "^3.2.3"
loader-utils "^0.2.16"
lodash "^4.17.3"
pretty-error "^2.0.2"
tapable "^1.0.0"
toposort "^1.0.0"
html-minifier "^3.5.20"
loader-utils "^1.1.0"
lodash "^4.17.11"
pretty-error "^2.1.1"
tapable "^1.1.0"
util.promisify "1.0.0"

htmlparser2@^3.9.1:
@@ -6042,15 +6044,6 @@ loader-runner@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-2.3.0.tgz#f482aea82d543e07921700d5a46ef26fdac6b8a2"

loader-utils@^0.2.16:
version "0.2.17"
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-0.2.17.tgz#f86e6374d43205a6e6c60e9196f17c0299bfb348"
dependencies:
big.js "^3.1.3"
emojis-list "^2.0.0"
json5 "^0.5.0"
object-assign "^4.0.1"

loader-utils@^1.0.1, loader-utils@^1.0.2, loader-utils@^1.0.4, loader-utils@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-1.1.0.tgz#c98aef488bcceda2ffb5e2de646d6a754429f5cd"
@@ -6203,7 +6196,7 @@ lodash.uniq@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"

lodash@^4.0.0, lodash@^4.13.1, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@~4.17.10:
lodash@^4.0.0, lodash@^4.13.1, lodash@^4.15.0, lodash@^4.17.10, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0, lodash@~4.17.10:
version "4.17.10"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7"

@@ -7679,9 +7672,10 @@ pretty-bytes@^1.0.2:
get-stdin "^4.0.1"
meow "^3.1.0"

pretty-error@^2.0.2:
pretty-error@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.1.1.tgz#5f4f87c8f91e5ae3f3ba87ab4cf5e03b1a17f1a3"
integrity sha1-X0+HyPkeWuPzuoerTPXgOxoX8aM=
dependencies:
renderkid "^2.0.1"
utila "~0.4"
@@ -9428,6 +9422,11 @@ tapable@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.0.0.tgz#cbb639d9002eed9c6b5975eb20598d7936f1f9f2"

tapable@^1.1.0:
version "1.1.3"
resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.1.3.tgz#a1fccc06b58db61fd7a45da2da44f5f3a3e67ba2"
integrity sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==

tar-stream@^1.5.0:
version "1.6.2"
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555"
@@ -9580,10 +9579,6 @@ to-regex@^3.0.1, to-regex@^3.0.2:
regex-not "^1.0.2"
safe-regex "^1.1.0"

toposort@^1.0.0:
version "1.0.7"
resolved "https://registry.yarnpkg.com/toposort/-/toposort-1.0.7.tgz#2e68442d9f64ec720b8cc89e6443ac6caa950029"

toposort@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/toposort/-/toposort-2.0.2.tgz#ae21768175d1559d48bef35420b2f4962f09c330"

0 comments on commit c2e6ea1

Please sign in to comment.