diff options
author | Alex Pott <alex.a.pott@googlemail.com> | 2022-04-15 13:12:47 +0100 |
---|---|---|
committer | Alex Pott <alex.a.pott@googlemail.com> | 2022-04-15 13:12:47 +0100 |
commit | b825f910842aa5eb2e6ad0a4c84cfe5969373b5c (patch) | |
tree | 4d0ac71aec38f84a6f7da34128a042b0f7a3990b /core/modules/ckeditor5/webpack.config.js | |
parent | 435dc2011de947b35a30bc87f9a4e7d032cf317d (diff) | |
download | drupal-b825f910842aa5eb2e6ad0a4c84cfe5969373b5c.tar.gz drupal-b825f910842aa5eb2e6ad0a4c84cfe5969373b5c.zip |
Issue #3233491 by hooroomoo, xjm, lauriii, nod_, justafish, droplet, effulgentsia: Create process for reviewing changes in 3rd party JavaScript dependencies
Diffstat (limited to 'core/modules/ckeditor5/webpack.config.js')
-rw-r--r-- | core/modules/ckeditor5/webpack.config.js | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/core/modules/ckeditor5/webpack.config.js b/core/modules/ckeditor5/webpack.config.js index 71152e4b1e5..4496eb61289 100644 --- a/core/modules/ckeditor5/webpack.config.js +++ b/core/modules/ckeditor5/webpack.config.js @@ -10,7 +10,9 @@ function getDirectories(srcpath) { .filter((item) => fs.statSync(path.join(srcpath, item)).isDirectory()); } -module.exports = []; +const prodPluginBuilds = []; +const devPluginBuilds = []; + // Loop through every subdirectory in ckeditor5_plugins, which should be a different // plugin, and build them all in ./build. getDirectories(path.resolve(__dirname, './js/ckeditor5_plugins')).forEach((dir) => { @@ -59,5 +61,17 @@ getDirectories(path.resolve(__dirname, './js/ckeditor5_plugins')).forEach((dir) }, }; - module.exports.push(bc); + const dev = {...bc, mode: 'development', optimization: {...bc.optimization, minimize: false}, devtool: false}; + + prodPluginBuilds.push(bc); + devPluginBuilds.push(dev); }); + +module.exports = (env, argv) => { + // Files aren't minified in build with the development flag. + if (argv.mode === 'development') { + return devPluginBuilds; + } else { + return prodPluginBuilds; + } +} |