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 | |
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
-rw-r--r-- | core/modules/ckeditor5/webpack.config.js | 18 | ||||
-rw-r--r-- | core/package.json | 4 |
2 files changed, 19 insertions, 3 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; + } +} diff --git a/core/package.json b/core/package.json index be4f74b43b0..159a6b69223 100644 --- a/core/package.json +++ b/core/package.json @@ -31,7 +31,9 @@ "watch:ckeditor5": "webpack --config ./modules/ckeditor5/webpack.config.js --watch", "build:ckeditor5": "webpack --config ./modules/ckeditor5/webpack.config.js", "check:ckeditor5": "node ./scripts/js/ckeditor5-check-plugins.js", - "build:ckeditor5-types": "node ./scripts/js/ckeditor5-types-documentation.js" + "build:ckeditor5-types": "node ./scripts/js/ckeditor5-types-documentation.js", + "build:ckeditor5-dev": "yarn build:ckeditor5 --mode=development", + "watch:ckeditor5-dev": "yarn watch:ckeditor5 --mode=development" }, "devDependencies": { "@babel/core": "^7.0.0", |