Skip to content

Commit

Permalink
feat(ui5-tooling-modules): de-support AMD modules to ensure copyright…
Browse files Browse the repository at this point in the history
… headers

Fixes #1163
  • Loading branch information
petermuessig committed Feb 7, 2025
1 parent ce6bb38 commit 2439c28
Show file tree
Hide file tree
Showing 18 changed files with 47,258 additions and 43,843 deletions.
2 changes: 1 addition & 1 deletion packages/ui5-tooling-modules/lib/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ module.exports = async function ({ log, resources, options, middlewareUtil }) {
debug && log.info(`Bundling took ${Date.now() - bundleTime} millis`);
bundleInfo.getEntries().forEach((entry) => {
if (entry.path) {
watcher.add(entry.path);
watcher?.add(entry.path);
debug && log.verbose(`[FSWATCHER] File ${entry.path} has been added`);
}
});
Expand Down
51 changes: 0 additions & 51 deletions packages/ui5-tooling-modules/lib/rollup-plugin-amd-custom.js

This file was deleted.

10 changes: 7 additions & 3 deletions packages/ui5-tooling-modules/lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const commonjs = require("@rollup/plugin-commonjs");
const json = require("@rollup/plugin-json");
const nodePolyfills = require("rollup-plugin-polyfill-node");
const nodePolyfillsOverride = require("./rollup-plugin-polyfill-node-override");
const amdCustom = require("./rollup-plugin-amd-custom");
const skipAssets = require("./rollup-plugin-skip-assets");
const injectESModule = require("./rollup-plugin-inject-esmodule");
const logger = require("./rollup-plugin-logger");
Expand Down Expand Up @@ -1078,7 +1077,6 @@ module.exports = function (log, projectInfo) {
commonjs({
defaultIsModuleExports: true,
}),
amdCustom(),
// node polyfills/resolution must happen after
// commonjs and amd to ensure e.g. exports is
// properly handled by those plugins
Expand Down Expand Up @@ -1261,7 +1259,13 @@ module.exports = function (log, projectInfo) {
options.afterPlugins.push(dynamicImports({ findPackageJson, keepDynamicImports }));
// when minifying the code, we add the terser plugin
if (minify) {
options.afterPlugins.push(require("@rollup/plugin-terser")());
options.afterPlugins.push(
require("@rollup/plugin-terser")({
output: {
comments: /^!/, // Keeps comments starting with "!"
},
}),
);
}
const nameOfModules = modules.map((module) => module.name);
//const millis = Date.now();
Expand Down
1 change: 0 additions & 1 deletion packages/ui5-tooling-modules/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"timeout": "20s"
},
"dependencies": {
"@buxlabs/amd-to-es6": "^0.16.3",
"@javascript-obfuscator/escodegen": "^2.3.0",
"@rollup/plugin-commonjs": "^28.0.2",
"@rollup/plugin-inject": "^5.0.5",
Expand Down
Loading

0 comments on commit 2439c28

Please sign in to comment.