fix: Create separate CJS and UMD builds (#2281)
This commit is contained in:
parent
bc1027fd3e
commit
62faaf4c91
5288
lib/marked.cjs
5288
lib/marked.cjs
File diff suppressed because one or more lines are too long
2913
lib/marked.umd.js
Normal file
2913
lib/marked.umd.js
Normal file
File diff suppressed because one or more lines are too long
2
marked.min.js
vendored
2
marked.min.js
vendored
File diff suppressed because one or more lines are too long
@ -6,7 +6,7 @@
|
||||
"type": "module",
|
||||
"main": "./lib/marked.cjs",
|
||||
"module": "./lib/marked.esm.js",
|
||||
"browser": "./lib/marked.cjs",
|
||||
"browser": "./lib/marked.umd.js",
|
||||
"bin": {
|
||||
"marked": "bin/marked.js"
|
||||
},
|
||||
|
@ -2,10 +2,10 @@ const commonjs = require('@rollup/plugin-commonjs');
|
||||
const babel = require('@rollup/plugin-babel').default;
|
||||
const license = require('rollup-plugin-license');
|
||||
|
||||
module.exports = {
|
||||
module.exports = [{
|
||||
input: 'src/marked.js',
|
||||
output: {
|
||||
file: 'lib/marked.cjs',
|
||||
file: 'lib/marked.umd.js',
|
||||
format: 'umd',
|
||||
name: 'marked'
|
||||
},
|
||||
@ -28,4 +28,31 @@ https://github.com/markedjs/marked
|
||||
presets: [['@babel/preset-env', { loose: true }]]
|
||||
})
|
||||
]
|
||||
};
|
||||
},
|
||||
{
|
||||
input: 'src/marked.js',
|
||||
output: {
|
||||
file: 'lib/marked.cjs',
|
||||
format: 'cjs',
|
||||
name: 'marked'
|
||||
},
|
||||
plugins: [
|
||||
license({
|
||||
banner: `
|
||||
DO NOT EDIT THIS FILE
|
||||
The code in this file is generated from files in ./src/
|
||||
`
|
||||
}),
|
||||
license({
|
||||
banner: `
|
||||
marked - a markdown parser
|
||||
Copyright (c) 2011-${new Date().getFullYear()}, Christopher Jeffrey. (MIT Licensed)
|
||||
https://github.com/markedjs/marked
|
||||
`
|
||||
}),
|
||||
commonjs(),
|
||||
babel({
|
||||
presets: [['@babel/preset-env', { loose: true }]]
|
||||
})
|
||||
]
|
||||
}];
|
||||
|
Loading…
x
Reference in New Issue
Block a user