diff --git a/.circleci/config.yml b/.circleci/config.yml index f17eaacf4..3d654278f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,9 +73,15 @@ jobs: - checkout - attach_workspace: at: ~/coralproject/talk + - restore_cache: + key: build-cache - run: name: Build static assets command: yarn build + - save_cache: + key: build-cache + paths: + - ./node_modules/.cache/hard-source - persist_to_workspace: root: . paths: dist diff --git a/package.json b/package.json index 48e0b1001..9c5f58ff5 100644 --- a/package.json +++ b/package.json @@ -115,6 +115,7 @@ "graphql-tag": "^1.2.3", "graphql-tools": "^0.10.1", "hammerjs": "^2.0.8", + "hard-source-webpack-plugin": "^0.6.0", "helmet": "3.8.2", "history": "^3.0.0", "hjson": "^3.1.1", diff --git a/webpack.config.js b/webpack.config.js index 00daeedee..2027061da 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -8,6 +8,7 @@ const _ = require('lodash'); const Copy = require('copy-webpack-plugin'); const webpack = require('webpack'); const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); +const HardSourceWebpackPlugin = require('hard-source-webpack-plugin'); const debug = require('debug')('talk:webpack'); // Possibly load the config from the .env file (if there is one). @@ -136,6 +137,7 @@ const config = { TALK_DEFAULT_LANG: 'en', }), new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/), + new HardSourceWebpackPlugin(), ], resolveLoader: { modules: [ diff --git a/yarn.lock b/yarn.lock index 7ba8aab3f..62eb054fb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2683,6 +2683,10 @@ detect-indent@^4.0.0: dependencies: repeating "^2.0.0" +detect-indent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" + detect-libc@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-0.2.0.tgz#47fdf567348a17ec25fcbf0b9e446348a76f9fb5" @@ -4237,6 +4241,19 @@ har-validator@~5.0.3: ajv "^5.1.0" har-schema "^2.0.0" +hard-source-webpack-plugin@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/hard-source-webpack-plugin/-/hard-source-webpack-plugin-0.6.0.tgz#ec2f60068a8d1f358439b7b1587f1c64fe642eda" + dependencies: + lodash "^4.15.0" + mkdirp "^0.5.1" + node-object-hash "^1.2.0" + rimraf "^2.6.2" + tapable "^1.0.0-beta.5" + webpack-core "~0.6.0" + webpack-sources "^1.0.1" + write-json-file "^2.3.0" + harmony-reflect@^1.4.6: version "1.5.1" resolved "https://registry.yarnpkg.com/harmony-reflect/-/harmony-reflect-1.5.1.tgz#b54ca617b00cc8aef559bbb17b3d85431dc7e329" @@ -7043,6 +7060,10 @@ node-notifier@^5.0.2: shellwords "^0.1.0" which "^1.2.12" +node-object-hash@^1.2.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/node-object-hash/-/node-object-hash-1.3.0.tgz#7f294f5afec6b08d713e40d40a95ec793e05baf3" + node-pre-gyp@^0.6.36, node-pre-gyp@^0.6.39: version "0.6.39" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649" @@ -9222,7 +9243,7 @@ right-align@^0.1.1: dependencies: align-text "^0.1.1" -rimraf@2, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1: +rimraf@2, rimraf@^2.5.1, rimraf@^2.5.4, rimraf@^2.6.1, rimraf@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.2.tgz#2ed8150d24a16ea8651e6d6ef0f47c4158ce7a36" dependencies: @@ -9686,10 +9707,20 @@ sort-keys@^1.0.0: dependencies: is-plain-obj "^1.0.0" +sort-keys@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" + dependencies: + is-plain-obj "^1.0.0" + source-list-map@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.0.tgz#aaa47403f7b245a92fbc97ea08f250d6087ed085" +source-list-map@~0.1.7: + version "0.1.8" + resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-0.1.8.tgz#c550b2ab5427f6b3f21f5afead88c4f5587b2106" + source-map-resolve@^0.5.0: version "0.5.1" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.1.tgz#7ad0f593f2281598e854df80f19aae4b92d7a11a" @@ -9722,7 +9753,7 @@ source-map@0.1.x: dependencies: amdefine ">=0.0.4" -source-map@0.4.x, source-map@^0.4.4: +source-map@0.4.x, source-map@^0.4.4, source-map@~0.4.1: version "0.4.4" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" dependencies: @@ -10100,6 +10131,10 @@ tapable@^0.2.7: version "0.2.8" resolved "https://registry.yarnpkg.com/tapable/-/tapable-0.2.8.tgz#99372a5c999bf2df160afc0d74bed4f47948cd22" +tapable@^1.0.0-beta.5: + version "1.0.0" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-1.0.0.tgz#cbb639d9002eed9c6b5975eb20598d7936f1f9f2" + tar-fs@^1.13.0: version "1.16.0" resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-1.16.0.tgz#e877a25acbcc51d8c790da1c57c9cf439817b896" @@ -10717,6 +10752,13 @@ webidl-conversions@^4.0.0, webidl-conversions@^4.0.1, webidl-conversions@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" +webpack-core@~0.6.0: + version "0.6.9" + resolved "https://registry.yarnpkg.com/webpack-core/-/webpack-core-0.6.9.tgz#fc571588c8558da77be9efb6debdc5a3b172bdc2" + dependencies: + source-list-map "~0.1.7" + source-map "~0.4.1" + webpack-sources@^1.0.1, webpack-sources@^1.0.2, webpack-sources@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.1.0.tgz#a101ebae59d6507354d71d8013950a3a8b7a5a54" @@ -10897,6 +10939,17 @@ write-file-atomic@^2.0.0, write-file-atomic@^2.1.0: imurmurhash "^0.1.4" signal-exit "^3.0.2" +write-json-file@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-2.3.0.tgz#2b64c8a33004d54b8698c76d585a77ceb61da32f" + dependencies: + detect-indent "^5.0.0" + graceful-fs "^4.1.2" + make-dir "^1.0.0" + pify "^3.0.0" + sort-keys "^2.0.0" + write-file-atomic "^2.0.0" + write@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/write/-/write-0.2.1.tgz#5fc03828e264cea3fe91455476f7a3c566cb0757"