加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/chjj/marked
克隆/下载
rollup.config.js 1.40 KB
一键复制 编辑 原始数据 按行查看 历史
import typescript from '@rollup/plugin-typescript';
import terser from '@rollup/plugin-terser';
import { defineConfig } from 'rollup';
import fs from 'fs';
const version = process.env.SEMANTIC_RELEASE_NEXT_VERSION || JSON.parse(fs.readFileSync('./package.json')).version;
console.log('building version:', version);
const banner = `/**
* marked v${version} - a markdown parser
* Copyright (c) 2011-${new Date().getFullYear()}, Christopher Jeffrey. (MIT Licensed)
* https://github.com/markedjs/marked
*/
/**
* DO NOT EDIT THIS FILE
* The code in this file is generated from files in ./src/
*/
`;
export default defineConfig([
{
input: 'src/marked.ts',
output: [{
file: 'lib/marked.esm.js',
format: 'esm',
sourcemap: true,
banner
},
{
file: 'lib/marked.umd.js',
format: 'umd',
name: 'marked',
sourcemap: true,
banner
},
{
file: 'marked.min.js',
format: 'umd',
name: 'marked',
sourcemap: false,
banner,
plugins: [terser({
format: {
comments: (node, comment) => {
if (comment.type === 'comment2') {
return comment.value.includes('Copyright (c)');
}
}
}
})]
},
{
file: 'lib/marked.cjs',
format: 'cjs',
name: 'marked',
sourcemap: true,
banner
}],
plugins: [
typescript()
]
}
]);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化