chore: pnpm v11 (#7942)
* chore: remove rolldown dep * fix: issues-helper and maintain-one-comment are temporarily disabled due to security issues * chore: update deps * fix: change error type to TypeError for non-browser environment check in LocalStorageDriver * chore: update pnpm v11
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
import type {
|
||||
NormalizedOutputOptions,
|
||||
OutputBundle,
|
||||
OutputChunk,
|
||||
} from 'rolldown';
|
||||
import type { PluginOption } from 'vite';
|
||||
|
||||
import { EOL } from 'node:os';
|
||||
@@ -13,7 +8,6 @@ import { dateUtil, readPackageJSON } from '@vben/node-utils';
|
||||
* 用于注入版权信息
|
||||
* @returns
|
||||
*/
|
||||
|
||||
async function viteLicensePlugin(
|
||||
root = process.cwd(),
|
||||
): Promise<PluginOption | undefined> {
|
||||
@@ -27,7 +21,7 @@ async function viteLicensePlugin(
|
||||
apply: 'build',
|
||||
enforce: 'post',
|
||||
generateBundle: {
|
||||
handler: (_options: NormalizedOutputOptions, bundle: OutputBundle) => {
|
||||
handler(_options, bundle) {
|
||||
const date = dateUtil().format('YYYY-MM-DD ');
|
||||
const copyrightText = `/*!
|
||||
* Vben Admin
|
||||
@@ -44,13 +38,11 @@ async function viteLicensePlugin(
|
||||
|
||||
for (const [, fileContent] of Object.entries(bundle)) {
|
||||
if (fileContent.type === 'chunk' && fileContent.isEntry) {
|
||||
const chunkContent = fileContent as OutputChunk;
|
||||
// 插入版权信息
|
||||
const content = chunkContent.code;
|
||||
const content = fileContent.code;
|
||||
const updatedContent = `${copyrightText}${EOL}${content}`;
|
||||
|
||||
// 更新bundle
|
||||
(fileContent as OutputChunk).code = updatedContent;
|
||||
fileContent.code = updatedContent;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user