Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,35 @@
"description": "Development base files for working with Patternslib and add-ons.",
"license": "MIT",
"dependencies": {
"@babel/core": "^7.18.6",
"@babel/eslint-parser": "^7.18.2",
"@babel/preset-env": "^7.18.6",
"@babel/core": "^7.18.10",
"@babel/eslint-parser": "^7.18.9",
"@babel/preset-env": "^7.18.10",
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@release-it/conventional-changelog": "^5.0.0",
"babel-loader": "^8.2.5",
"core-js": "3.23.3",
"core-js": "3.24.1",
"css-loader": "^6.7.1",
"eslint": "^8.19.0",
"eslint": "^8.21.0",
"eslint-config-prettier": "^8.5.0",
"husky": "^8.0.1",
"identity-obj-proxy": "^3.0.0",
"imports-loader": "^4.0.0",
"jest": "^28.1.2",
"jest-environment-jsdom": "^28.1.2",
"jest-watch-typeahead": "^1.1.0",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"jest-watch-typeahead": "^2.0.0",
"prettier": "^2.7.1",
"regenerator-runtime": "^0.13.9",
"release-it": "^15.1.1",
"sass": "^1.53.0",
"release-it": "^15.3.0",
"sass": "^1.54.4",
"sass-loader": "^13.0.2",
"style-loader": "^3.3.0",
"terser-webpack-plugin": "^5.3.3",
"timezone-mock": "^1.3.4",
"webpack": "^5.73.0",
"webpack": "^5.74.0",
"webpack-bundle-analyzer": "^4.4.2",
"webpack-cli": "^4.10.0",
"webpack-dev-server": "^4.9.3",
"webpack-dev-server": "^4.10.0",
"whybundled": "^2.0.0",
"yarn": "^1.22.19"
},
Expand Down
24 changes: 18 additions & 6 deletions webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const webpack_helpers = require("./webpack-helpers");
// plugins
const TerserPlugin = require("terser-webpack-plugin");

module.exports = (env, argv, config, babel_include = []) => {
const config_factory = (env, argv, config, babel_include = [], package_json) => {
// Webpack config

// Packages in node_modules to NOT exclude from babel processing.
Expand Down Expand Up @@ -96,6 +96,15 @@ module.exports = (env, argv, config, babel_include = []) => {
],
};

if (package_json && package_json.version && package_json.name) {
// Add a banner to generated chunks with the bundle name and version.
base_config.plugins.push(
new webpack.BannerPlugin({
banner: `${package_json.name} ${package_json.version}`,
})
);
}

// Override base_config with entries from config.
// Most useful the ``entry`` entry.
config = Object.assign(base_config, config);
Expand Down Expand Up @@ -124,14 +133,17 @@ module.exports = (env, argv, config, babel_include = []) => {
new TerserPlugin({
include: /(\.js$)/,
extractComments: false,
terserOptions: {
output: {
comments: false,
},
},
}),
];
config.devtool = "source-map"; // Slowest option. False for no source maps.
}
return config;
};

// Default export
const module_exports = (module.exports = config_factory);

// Named exports
module_exports.config = ({ env, argv, config, babel_include = [], package_json }) => {
return config_factory(env, argv, config, babel_include, package_json);
};
2 changes: 1 addition & 1 deletion webpack/webpack.mf.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function shared_from_dependencies(...dependencies) {
*
* Use this to extend your webpack configuration for module federation support.
*
* @param {String} name - Bundle/remote name. If not given, the package.json name is used.
* @param {String} name - Bundle/remote name.
* @param {String} remote_entry - Path to which the new remote entry file is written to.
* @param {String} filename - Name of the generated remote entry file. Default ``remote.min.js``.
* @param {Object} dependencies - Object with dependency name - version specifier pairs. Is used to set up the shared dependencies including their version requirements.
Expand Down
Loading