fix: Create separate CJS and UMD builds (#2281)
This commit is contained in:
parent
bc1027fd3e
commit
62faaf4c91
@ -9,11 +9,9 @@
|
||||
* The code in this file is generated from files in ./src/
|
||||
*/
|
||||
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.marked = {}));
|
||||
})(this, (function (exports) { 'use strict';
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
function _defineProperties(target, props) {
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
@ -2907,7 +2905,3 @@
|
||||
exports.setOptions = setOptions;
|
||||
exports.use = use;
|
||||
exports.walkTokens = walkTokens;
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
}));
|
||||
|
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