diff --git a/package-lock.json b/package-lock.json index d35d615616a..282e55e3f1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1505,6 +1505,11 @@ "integrity": "sha512-HiUX/+K2YpkpJ+SzBffkM/AQ2YE03S0U1kjTLVpoJdhZMOWy8qvXVN9JdLqv2QsaQ6MPYQIuNmwD8zOiYUofLQ==", "dev": true }, + "add-asset-webpack-plugin": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/add-asset-webpack-plugin/-/add-asset-webpack-plugin-1.0.0.tgz", + "integrity": "sha512-Pg6UTxMPmVpGobpBTBmTO54aKvZfnY/rm7YvY86BXv4toE8I29ail6kAzsf0GyEMK6MgvGVDxs4IZXPTCUooNw==" + }, "aggregate-error": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", diff --git a/package.json b/package.json index 983ec0edcfb..3b5ba482ee7 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "@babel/runtime": "7.11.2", "@claviska/jquery-minicolors": "2.3.5", "@primer/octicons": "10.0.0", + "add-asset-webpack-plugin": "1.0.0", "babel-loader": "8.1.0", "clipboard": "2.0.6", "core-js": "3.6.5", diff --git a/webpack.config.js b/webpack.config.js index d7f0c83d8ac..9a69c550f20 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,5 +1,6 @@ const fastGlob = require('fast-glob'); const wrapAnsi = require('wrap-ansi'); +const AddAssetPlugin = require('add-asset-webpack-plugin'); const CssMinimizerPlugin = require('css-minimizer-webpack-plugin'); const FixStyleOnlyEntriesPlugin = require('webpack-fix-style-only-entries'); const MiniCssExtractPlugin = require('mini-css-extract-plugin'); @@ -273,7 +274,7 @@ module.exports = { new MonacoWebpackPlugin({ filename: 'js/monaco-[name].worker.js', }), - new LicenseWebpackPlugin({ + isProduction ? new LicenseWebpackPlugin({ outputFilename: 'js/licenses.txt', perChunkOutput: false, addBanner: false, @@ -281,6 +282,9 @@ module.exports = { modulesDirectories: [ resolve(__dirname, 'node_modules'), ], + additionalModules: [ + '@primer/octicons', + ].map((name) => ({name, directory: resolve(__dirname, `node_modules/${name}`)})), renderLicenses: (modules) => { const line = '-'.repeat(80); return modules.map((module) => { @@ -294,7 +298,7 @@ module.exports = { warnings: false, errors: true, }, - }), + }) : new AddAssetPlugin('js/licenses.txt', `Licenses are disabled during development`), ], performance: { hints: false,