2022-11-10 19:46:16 -06:00
|
|
|
import babel from '@rollup/plugin-babel';
|
2023-01-13 21:27:58 -05:00
|
|
|
import { defineConfig } from 'rollup';
|
|
|
|
import fs from 'fs';
|
|
|
|
|
|
|
|
const pkg = JSON.parse(fs.readFileSync('./package.json'));
|
2023-01-13 20:42:59 -06:00
|
|
|
const version = process.env.SEMANTIC_RELEASE_NEXT_VERSION || pkg.version;
|
|
|
|
|
|
|
|
console.log('building version:', version);
|
2019-11-06 11:11:06 -06:00
|
|
|
|
2022-11-10 19:46:16 -06:00
|
|
|
const banner = `/**
|
2023-01-13 20:42:59 -06:00
|
|
|
* marked v${version} - a markdown parser
|
2022-11-10 19:46:16 -06:00
|
|
|
* 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/
|
|
|
|
*/
|
|
|
|
`;
|
|
|
|
|
2023-01-13 20:42:59 -06:00
|
|
|
export default defineConfig([
|
|
|
|
{
|
|
|
|
input: 'src/marked.js',
|
|
|
|
output: {
|
|
|
|
file: 'lib/marked.esm.js',
|
|
|
|
format: 'esm',
|
|
|
|
banner
|
|
|
|
}
|
2019-11-05 15:30:38 -06:00
|
|
|
},
|
2023-01-13 21:27:58 -05:00
|
|
|
{
|
2023-01-13 20:42:59 -06:00
|
|
|
input: 'src/marked.js',
|
|
|
|
output: [{
|
|
|
|
file: 'lib/marked.umd.js',
|
|
|
|
format: 'umd',
|
|
|
|
name: 'marked',
|
|
|
|
banner
|
|
|
|
},
|
|
|
|
{
|
|
|
|
file: 'lib/marked.cjs',
|
|
|
|
format: 'cjs',
|
|
|
|
name: 'marked',
|
|
|
|
banner
|
|
|
|
}],
|
|
|
|
plugins: [
|
|
|
|
babel({
|
|
|
|
presets: [['@babel/preset-env', { loose: true }]]
|
|
|
|
})
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]);
|