Skip to content

Commit

Permalink
Remove license comments from the UMD build (#1437)
Browse files Browse the repository at this point in the history
* Install terser plugin explicite to enable extensive customization

* Remove license comment from the UMD builds using string-replace-loader webpack plugin

* Test for the redundant license comments in the UMD build inside the verify:umd script
  • Loading branch information
sequba authored Aug 6, 2024
1 parent f082027 commit 67bae9e
Show file tree
Hide file tree
Showing 4 changed files with 678 additions and 151 deletions.
9 changes: 9 additions & 0 deletions .config/webpack/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const path = require('path');
const fs = require('fs');
const { BannerPlugin } = require('webpack');

const licenseComment = fs.readFileSync(path.resolve(__dirname, '../source-license-header.js'), 'utf8').trim();
let licensePreamble = fs.readFileSync(path.resolve(__dirname, '../../LICENSE.txt'), 'utf8');

licensePreamble += '\n\nVersion: ' + process.env.HT_VERSION;
Expand Down Expand Up @@ -42,6 +43,14 @@ module.exports.create = function create(processedFile) {
}
]
},
{
test: /\.js$/,
loader: 'string-replace-loader',
options: {
search: licenseComment,
replace: '',
}
}
]
},
plugins: [
Expand Down
Loading

0 comments on commit 67bae9e

Please sign in to comment.