mirror of
https://gitee.com/layui/layui.git
synced 2025-11-09 10:54:59 +08:00
chore: initial commit (#2906)
This commit is contained in:
19
scripts/rollup-plugins.mjs
Normal file
19
scripts/rollup-plugins.mjs
Normal file
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Rollup Custom Plugins
|
||||
*/
|
||||
|
||||
// 压缩后添加头部注释
|
||||
export function banner(options = {}) {
|
||||
const bannerComment = options.comment || '';
|
||||
return {
|
||||
name: 'banner',
|
||||
generateBundle(_, bundle) {
|
||||
// chunk 生成后
|
||||
for (const file of Object.values(bundle)) {
|
||||
if (file.type === 'chunk') {
|
||||
file.code = bannerComment + file.code;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user