diff --git a/package-lock.json b/package-lock.json index c787faf9..17bcc6e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3795,6 +3795,14 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" }, + "lodash-webpack-plugin": { + "version": "0.11.4", + "resolved": "https://registry.npmjs.org/lodash-webpack-plugin/-/lodash-webpack-plugin-0.11.4.tgz", + "integrity": "sha1-bD7Lo9S40ktTlAtjVCcVxe08SsU=", + "requires": { + "lodash": "4.17.4" + } + }, "lodash._basecallback": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/lodash._basecallback/-/lodash._basecallback-3.3.1.tgz", diff --git a/package.json b/package.json index 8e7414fb..4c58c763 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "intersection-observer": "^0.5.0", "intl-relativeformat": "^2.1.0", "lodash": "^4.17.4", + "lodash-webpack-plugin": "^0.11.4", "marky": "^1.2.0", "node-fetch": "^1.7.3", "node-sass": "^4.7.2", diff --git a/webpack.client.config.js b/webpack.client.config.js index b5cd8848..a7b5df81 100644 --- a/webpack.client.config.js +++ b/webpack.client.config.js @@ -3,6 +3,7 @@ const config = require('sapper/webpack/config.js') const ExtractTextPlugin = require('extract-text-webpack-plugin') const UglifyJSPlugin = require('uglifyjs-webpack-plugin') const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin +var LodashModuleReplacementPlugin = require('lodash-webpack-plugin') const isDev = config.dev; @@ -63,6 +64,7 @@ module.exports = { }), /* disable while https://github.com/sveltejs/sapper/issues/79 is open */ //new ExtractTextPlugin('main.css'), + new LodashModuleReplacementPlugin(), new webpack.optimize.ModuleConcatenationPlugin(), new UglifyJSPlugin(), new BundleAnalyzerPlugin({ // generates report.html and stats.json