File tree Expand file tree Collapse file tree 6 files changed +550
-74
lines changed
Expand file tree Collapse file tree 6 files changed +550
-74
lines changed Original file line number Diff line number Diff line change 3131 run : npm run test:unit
3232 - name : Run Spec Tests 👩🏽💻
3333 run : npm run test:specs
34+ - name : Run CJS Tests 👩🏽💻
35+ run : npm run test:cjs
3436
3537 OtherTests :
3638 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 1+ import * as esbuild from 'esbuild' ;
2+ import { umdWrapper } from 'esbuild-plugin-umd-wrapper' ;
3+ import fs from 'fs' ;
4+
5+ const version = process . env . SEMANTIC_RELEASE_NEXT_VERSION || JSON . parse ( fs . readFileSync ( './package.json' ) ) . version ;
6+
7+ console . log ( 'building version:' , version ) ;
8+
9+ const banner = `/**
10+ * marked v${ version } - a markdown parser
11+ * Copyright (c) 2011-${ new Date ( ) . getFullYear ( ) } , Christopher Jeffrey. (MIT Licensed)
12+ * https://github.com/markedjs/marked
13+ */
14+
15+ /**
16+ * DO NOT EDIT THIS FILE
17+ * The code in this file is generated from files in ./src/
18+ */
19+ ` ;
20+
21+ function config ( options ) {
22+ return {
23+ entryPoints : [ 'src/marked.ts' ] ,
24+ banner : {
25+ js : banner ,
26+ } ,
27+ sourcemap : true ,
28+ bundle : true ,
29+ minify : false ,
30+ ...( options . format === 'umd'
31+ ? {
32+ plugins : [ umdWrapper ( {
33+ libraryName : 'marked' ,
34+ } ) ] ,
35+ }
36+ : { } ) ,
37+ ...options ,
38+ } ;
39+ }
40+
41+ await esbuild . build ( config ( {
42+ format : 'esm' ,
43+ outfile : 'lib/marked.esm.js' ,
44+ } ) ) ;
45+
46+ await esbuild . build ( config ( {
47+ format : 'cjs' ,
48+ outfile : 'lib/marked.cjs' ,
49+ } ) ) ;
50+
51+ await esbuild . build ( config ( {
52+ format : 'umd' ,
53+ outfile : 'lib/marked.umd.js' ,
54+ } ) ) ;
55+
56+ await esbuild . build ( config ( {
57+ sourcemap : false ,
58+ minify : true ,
59+ format : 'umd' ,
60+ outfile : 'marked.min.js' ,
61+ } ) ) ;
You can’t perform that action at this time.
0 commit comments