diff --git a/package-lock.json b/package-lock.json index 12d9e8e..17323d3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4480,6 +4480,15 @@ "mkdirp": "0.5.1" } }, + "html-webpack-inline-chunk-plugin": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/html-webpack-inline-chunk-plugin/-/html-webpack-inline-chunk-plugin-1.1.1.tgz", + "integrity": "sha1-a8fXhOHmaKUOYdFO4VYLYH46ecg=", + "requires": { + "lodash": "4.17.4", + "source-map-url": "0.4.0" + } + }, "html-webpack-plugin": { "version": "2.30.1", "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-2.30.1.tgz", @@ -5437,8 +5446,7 @@ "lodash": { "version": "4.17.4", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", - "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", - "dev": true + "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" }, "lodash._basecopy": { "version": "3.0.1", @@ -7949,6 +7957,11 @@ "source-map": "0.5.7" } }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" + }, "sparkles": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz", diff --git a/package.json b/package.json index 0551ef1..d2e6779 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "dependencies": { "babel-polyfill": "^6.26.0", "hash-router": "^0.4.0", + "html-webpack-inline-chunk-plugin": "^1.1.1", "moment": "^2.19.3", "moment-locales-webpack-plugin": "^1.0.2", "unfetch": "^3.0.0" diff --git a/webpack.config.js b/webpack.config.js index 4c712f8..e2ef2f5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -13,6 +13,7 @@ const path = require('path'); const webpack = require('webpack'); +const InlineChunkWebpackPlugin = require('html-webpack-inline-chunk-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); const HtmlWebpackHarddiskPlugin = require('html-webpack-harddisk-plugin'); const MomentLocalesPlugin = require('moment-locales-webpack-plugin'); @@ -99,6 +100,10 @@ module.exports = { name: 'runtime', minChunks: Infinity, }), + // Inline the webpack’s runtime + new InlineChunkWebpackPlugin({ + inlineChunks: ['runtime'], + }), ] : [ // Force writing the HTML files to disk when running in the development mode