Skip to content

Commit

Permalink
Merge pull request #1638 from HSLdevcom/fix-webpack-caching
Browse files Browse the repository at this point in the history
Fix webpack caching
  • Loading branch information
hannesj authored Jun 1, 2017
2 parents 65e5b2a + d33c604 commit 4a6803c
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 62 deletions.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ "name": "digitransit-ui",
{
"name": "digitransit-ui",
"version": "0.0.1",
"description": "Digitransit UI - open nationwide journey planning platform",
"author": "[email protected]",
Expand Down Expand Up @@ -78,6 +79,7 @@
"moment": "2.17.1",
"moment-timezone": "0.5.11",
"mqtt": "2.4.0",
"name-all-modules-plugin": "^1.0.1",
"node-fetch": "1.6.3",
"offline-plugin": "4.6.1",
"pbf": "3.0.5",
Expand Down Expand Up @@ -144,12 +146,11 @@
"sass-loader": "6.0.2",
"selenium-webdriver": "3.1.0",
"stats-webpack-plugin": "0.5.0",
"style-loader": "0.13.2",
"stylelint": "7.8.0",
"stylelint-scss": "1.4.1",
"style-loader": "0.13.2",
"url-loader": "0.5.8",
"webpack": "2.6.1",
"webpack-dev-server": "2.4.1",
"webpack-md5-hash": "0.0.5"
"webpack-dev-server": "2.4.1"
}
}
14 changes: 10 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const csswring = require('csswring');
const StatsPlugin = require('stats-webpack-plugin');
// const OptimizeJsPlugin = require('optimize-js-plugin');
const OfflinePlugin = require('offline-plugin');
const WebpackMd5Hash = require('webpack-md5-hash');
const NameAllModulesPlugin = require('name-all-modules-plugin');
const GzipCompressionPlugin = require('compression-webpack-plugin');
const BrotliCompressionPlugin = require('brotli-webpack-plugin');
const FaviconsWebpackPlugin = require('favicons-webpack-plugin');
Expand Down Expand Up @@ -197,8 +197,8 @@ function getPluginsConfig(env) {
new webpack.ContextReplacementPlugin(reactIntlExpression, languageExpression),
new webpack.ContextReplacementPlugin(intlExpression, languageExpression),
new webpack.DefinePlugin({ 'process.env': { NODE_ENV: JSON.stringify('production') } }),
new webpack.HashedModuleIdsPlugin({ hashDigestLength: 6 }),
new WebpackMd5Hash(),
new webpack.NamedChunksPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.LoaderOptionsPlugin({
debug: false,
minimize: true,
Expand All @@ -210,9 +210,15 @@ function getPluginsConfig(env) {
getSourceMapPlugin(/\.(css)($|\?)/i, '/css/'),
new webpack.optimize.CommonsChunkPlugin({
names: ['common', 'leaflet', 'manifest'],
minChunks: Infinity,
}),
new webpack.optimize.CommonsChunkPlugin({
children: true,
async: true,
}),
new webpack.optimize.AggressiveMergingPlugin({ minSizeReduce: 1.2 }),
new webpack.optimize.MinChunkSizePlugin({ minChunkSize: 60000 }),
new webpack.optimize.MinChunkSizePlugin({ minChunkSize: 30000 }),
new NameAllModulesPlugin(),
new StatsPlugin('../stats.json', { chunkModules: true }),
new webpack.optimize.UglifyJsPlugin({
sourceMap: true,
Expand Down
142 changes: 88 additions & 54 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ acorn-jsx@^3.0.0, acorn-jsx@^3.0.1:
dependencies:
acorn "^3.0.4"

[email protected], acorn@^4.0.3, acorn@^4.0.4:
[email protected], acorn@^4.0.3:
version "4.0.4"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.4.tgz#17a8d6a7a6c4ef538b814ec9abac2779293bf30a"

Expand All @@ -70,6 +70,10 @@ acorn@^3.0.0, acorn@^3.0.4, acorn@^3.1.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"

acorn@^5.0.0:
version "5.0.3"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d"

adm-zip@^0.4.7:
version "0.4.7"
resolved "https://registry.yarnpkg.com/adm-zip/-/adm-zip-0.4.7.tgz#8606c2cbf1c426ce8c8ec00174447fd49b6eafc1"
Expand Down Expand Up @@ -341,7 +345,7 @@ [email protected], async@^1.3.0, async@^1.4.0, async@^1.5.0, async@^1.5.2:
version "1.5.2"
resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a"

[email protected]:
[email protected], async@^2.1.2, async@^2.1.5:
version "2.4.1"
resolved "https://registry.yarnpkg.com/async/-/async-2.4.1.tgz#62a56b279c98a11d0987096a01cc3eeb8eb7bbd7"
dependencies:
Expand All @@ -351,12 +355,6 @@ async@^0.9.0, async@~0.9.0:
version "0.9.2"
resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d"

async@^2.1.2, async@^2.1.5:
version "2.1.5"
resolved "https://registry.yarnpkg.com/async/-/async-2.1.5.tgz#e587c68580994ac67fc56ff86d3ac56bdbe810bc"
dependencies:
lodash "^4.14.0"

async@~1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/async/-/async-1.0.0.tgz#f8fc04ca3a13784ade9e1641af98578cfbd647a9"
Expand Down Expand Up @@ -1608,10 +1606,6 @@ change-emitter@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/change-emitter/-/change-emitter-0.1.2.tgz#6b88ca4d5d864e516f913421b11899a860aee8db"

charenc@~0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/charenc/-/charenc-0.0.1.tgz#004cff9feaf102382ed12db58dd6f962796d6e88"

cheerio@^0.19.0:
version "0.19.0"
resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.19.0.tgz#772e7015f2ee29965096d71ea4175b75ab354925"
Expand Down Expand Up @@ -2061,17 +2055,21 @@ create-hmac@^1.1.0, create-hmac@^1.1.2:
create-hash "^1.1.0"
inherits "^2.0.1"

create-react-class@^15.5.1:
version "15.5.3"
resolved "https://registry.yarnpkg.com/create-react-class/-/create-react-class-15.5.3.tgz#fb0f7cae79339e9a179e194ef466efa3923820fe"
dependencies:
fbjs "^0.8.9"
loose-envify "^1.3.1"
object-assign "^4.1.1"

cross-spawn@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982"
dependencies:
lru-cache "^4.0.1"
which "^1.2.9"

crypt@~0.0.1:
version "0.0.1"
resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.1.tgz#5f11b21a6c05ef1b5e79708366da6374ece1e6a2"

[email protected]:
version "2.0.5"
resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-2.0.5.tgz#3bdfecdc608147c1c67202fa291e7dca59eaa3b8"
Expand Down Expand Up @@ -3230,6 +3228,18 @@ fbjs@^0.8.1, fbjs@^0.8.4, fbjs@^0.8.6:
promise "^7.1.1"
ua-parser-js "^0.7.9"

fbjs@^0.8.9:
version "0.8.12"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.12.tgz#10b5d92f76d45575fd63a217d4ea02bea2f8ed04"
dependencies:
core-js "^1.0.0"
isomorphic-fetch "^2.1.1"
loose-envify "^1.0.0"
object-assign "^4.1.0"
promise "^7.1.1"
setimmediate "^1.0.5"
ua-parser-js "^0.7.9"

fd-slicer@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.0.1.tgz#8b5bcbd9ec327c5041bf9ab023fd6750f1177e65"
Expand Down Expand Up @@ -3328,12 +3338,14 @@ flatten@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782"

[email protected].9:
version "0.2.9"
resolved "https://registry.yarnpkg.com/fluxible-addons-react/-/fluxible-addons-react-0.2.9.tgz#cc7056f9108d6a1c6747d2cbaae1f9b594b3eb89"
[email protected].12:
version "0.2.12"
resolved "https://registry.yarnpkg.com/fluxible-addons-react/-/fluxible-addons-react-0.2.12.tgz#8bdb5798a4a6ec5f814955fb181bab61bd1d1537"
dependencies:
create-react-class "^15.5.1"
hoist-non-react-statics "^1.0.4"
inherits "^2.0.1"
prop-types "^15.5.8"

[email protected]:
version "1.2.0"
Expand Down Expand Up @@ -4310,7 +4322,7 @@ is-binary-path@^1.0.0:
dependencies:
binary-extensions "^1.0.0"

is-buffer@^1.0.2, is-buffer@^1.1.0, is-buffer@~1.1.1:
is-buffer@^1.0.2, is-buffer@^1.1.0:
version "1.1.4"
resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.4.tgz#cfc86ccd5dc5a52fa80489111c6920c457e2d98b"

Expand Down Expand Up @@ -4691,7 +4703,7 @@ [email protected], json3@^3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1"

json5@^0.5.0:
json5@^0.5.0, json5@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821"

Expand Down Expand Up @@ -5145,6 +5157,12 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.2.0:
dependencies:
js-tokens "^2.0.0"

loose-envify@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848"
dependencies:
js-tokens "^3.0.0"

loud-rejection@^1.0.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/loud-rejection/-/loud-rejection-1.6.0.tgz#5b46f80147edee578870f086d04821cf998e551f"
Expand Down Expand Up @@ -5234,14 +5252,6 @@ math-expression-evaluator@^1.2.14:
dependencies:
lodash.indexof "^4.0.5"

md5@^2.0.0:
version "2.2.1"
resolved "https://registry.yarnpkg.com/md5/-/md5-2.2.1.tgz#53ab38d5fe3c8891ba465329ea23fac0540126f9"
dependencies:
charenc "~0.0.1"
crypt "~0.0.1"
is-buffer "~1.1.1"

measured@^1.0.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/measured/-/measured-1.1.0.tgz#7f6a33adee77bc67a1648968c573608c291b9ac4"
Expand Down Expand Up @@ -5585,6 +5595,10 @@ mysql2@^1.2.0:
seq-queue "0.0.5"
sqlstring "^2.2.0"

name-all-modules-plugin@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/name-all-modules-plugin/-/name-all-modules-plugin-1.0.1.tgz#0abfb6ad835718b9fb4def0674e06657a954375c"

[email protected]:
version "1.1.1"
resolved "https://registry.yarnpkg.com/named-placeholders/-/named-placeholders-1.1.1.tgz#3b7a0d26203dd74b3a9df4c9cfb827b2fb907e64"
Expand Down Expand Up @@ -6849,6 +6863,13 @@ promise@^7.1.1:
dependencies:
asap "~2.0.3"

prop-types@^15.5.8:
version "15.5.10"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154"
dependencies:
fbjs "^0.8.9"
loose-envify "^1.3.1"

protocol-buffers-schema@^2.0.2:
version "2.2.0"
resolved "https://registry.yarnpkg.com/protocol-buffers-schema/-/protocol-buffers-schema-2.2.0.tgz#d29c6cd73fb655978fb6989691180db844119f61"
Expand Down Expand Up @@ -7034,14 +7055,15 @@ [email protected]:
version "3.15.0"
resolved "https://registry.yarnpkg.com/raven-js/-/raven-js-3.15.0.tgz#ebf95466b7d40fbbc3d6a5085af7c1431607926c"

raven@1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/raven/-/raven-1.1.3.tgz#4273c1ae6d34e4230f51b2c01041a32b9232822a"
raven@2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/raven/-/raven-2.0.2.tgz#a43d3b8702ae6db2e91987628be8f289500810ae"
dependencies:
cookie "0.3.1"
json-stringify-safe "5.0.1"
lsmod "1.0.0"
stack-trace "0.0.9"
timed-out "4.0.1"
uuid "3.0.0"

raven@^0.12.1:
Expand Down Expand Up @@ -7835,7 +7857,7 @@ set-immediate-shim@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61"

"setimmediate@>= 1.0.1 < 2", "setimmediate@>= 1.0.2 < 2", setimmediate@^1.0.2, setimmediate@^1.0.4:
"setimmediate@>= 1.0.1 < 2", "setimmediate@>= 1.0.2 < 2", setimmediate@^1.0.2, setimmediate@^1.0.4, setimmediate@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"

Expand Down Expand Up @@ -8003,6 +8025,10 @@ source-list-map@^0.1.7, source-list-map@~0.1.0, source-list-map@~0.1.7:
version "0.1.7"
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-0.1.7.tgz#d4b5ce2a46535c72c7e8527c71a77d250618172e"

source-list-map@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-1.1.2.tgz#9889019d1024cce55cdc069498337ef6186a11a1"

source-map-resolve@^0.3.0:
version "0.3.1"
resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.3.1.tgz#610f6122a445b8dd51535a2a71b783dfc1248761"
Expand Down Expand Up @@ -8558,6 +8584,10 @@ thunkify@~2.1.1:
version "2.1.2"
resolved "https://registry.yarnpkg.com/thunkify/-/thunkify-2.1.2.tgz#faa0e9d230c51acc95ca13a361ac05ca7e04553d"

[email protected]:
version "4.0.1"
resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f"

timed-out@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-2.0.0.tgz#f38b0ae81d3747d628001f41dafc652ace671c0a"
Expand Down Expand Up @@ -8696,7 +8726,16 @@ ua-parser-js@^0.7.9:
version "0.7.12"
resolved "https://registry.yarnpkg.com/ua-parser-js/-/ua-parser-js-0.7.12.tgz#04c81a99bdd5dc52263ea29d24c6bf8d4818a4bb"

[email protected], uglify-js@^2.6, uglify-js@^2.7.3, uglify-js@^2.7.5, uglify-js@~2.7.3:
[email protected], uglify-js@^2.6, uglify-js@^2.8.27:
version "2.8.27"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.27.tgz#47787f912b0f242e5b984343be8e35e95f694c9c"
dependencies:
source-map "~0.5.1"
yargs "~3.10.0"
optionalDependencies:
uglify-to-browserify "~1.0.0"

uglify-js@^2.7.3, uglify-js@~2.7.3:
version "2.7.5"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.7.5.tgz#4612c0c7baaee2ba7c487de4904ae122079f2ca8"
dependencies:
Expand Down Expand Up @@ -8974,9 +9013,9 @@ watchpack@^0.2.1:
chokidar "^1.0.0"
graceful-fs "^4.1.2"

watchpack@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.2.0.tgz#15d4620f1e7471f13fcb551d5c030d2c3eb42dbb"
watchpack@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-1.3.1.tgz#7d8693907b28ce6013e7f3610aa2a1acf07dad87"
dependencies:
async "^2.1.2"
chokidar "^1.4.3"
Expand Down Expand Up @@ -9042,38 +9081,33 @@ [email protected]:
webpack-dev-middleware "^1.9.0"
yargs "^6.0.0"

[email protected]:
version "0.0.5"
resolved "https://registry.yarnpkg.com/webpack-md5-hash/-/webpack-md5-hash-0.0.5.tgz#d9f1899ead664459dd8b6b0c926ac71cfbd7bc7a"
dependencies:
md5 "^2.0.0"

webpack-sources@^0.1.0:
version "0.1.3"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.1.3.tgz#15ce2fb79d0a1da727444ba7c757bf164294f310"
dependencies:
source-list-map "~0.1.0"
source-map "~0.5.3"

webpack-sources@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.1.4.tgz#ccc2c817e08e5fa393239412690bb481821393cd"
webpack-sources@^0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-0.2.3.tgz#17c62bfaf13c707f9d02c479e0dcdde8380697fb"
dependencies:
source-list-map "~0.1.7"
source-list-map "^1.1.1"
source-map "~0.5.3"

webpack@2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-2.2.1.tgz#7bb1d72ae2087dd1a4af526afec15eed17dda475"
webpack@2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/webpack/-/webpack-2.6.1.tgz#2e0457f0abb1ac5df3ab106c69c672f236785f07"
dependencies:
acorn "^4.0.4"
acorn "^5.0.0"
acorn-dynamic-import "^2.0.0"
ajv "^4.7.0"
ajv-keywords "^1.1.1"
async "^2.1.2"
enhanced-resolve "^3.0.0"
interpret "^1.0.0"
json-loader "^0.5.4"
json5 "^0.5.1"
loader-runner "^2.3.0"
loader-utils "^0.2.16"
memory-fs "~0.4.1"
Expand All @@ -9082,9 +9116,9 @@ [email protected]:
source-map "^0.5.3"
supports-color "^3.1.0"
tapable "~0.2.5"
uglify-js "^2.7.5"
watchpack "^1.2.0"
webpack-sources "^0.1.4"
uglify-js "^2.8.27"
watchpack "^1.3.1"
webpack-sources "^0.2.3"
yargs "^6.0.0"

webpack@^1.13.0:
Expand Down

0 comments on commit 4a6803c

Please sign in to comment.