File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,35 @@ const esmConfigs = [
8787 } ,
8888] ;
8989
90+ const cjsConfigs = [
91+ {
92+ input : 'src/index.ts' ,
93+ output : {
94+ file : 'lib/index.js' ,
95+ format : 'cjs' ,
96+ exports : 'named' ,
97+ sourcemap : true ,
98+ } ,
99+ plugins : getPlugins ( { browser : false , outDir : 'lib' } ) ,
100+ } ,
101+ {
102+ input : 'src/client/html-to-dom.ts' ,
103+ output : {
104+ file : 'lib/client/html-to-dom.js' ,
105+ format : 'cjs' ,
106+ exports : 'named' ,
107+ sourcemap : true ,
108+ } ,
109+ plugins : getPlugins ( { browser : true , outDir : 'lib/client' } ) ,
110+ } ,
111+ ] ;
112+
90113const configs = [ ] ;
91114
115+ if ( process . env . CJS === 'true' ) {
116+ configs . push ( ...cjsConfigs ) ;
117+ }
118+
92119if ( process . env . ESM === 'true' ) {
93120 configs . push ( ...esmConfigs ) ;
94121}
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
33if [[ $1 == ' --cjs' ]]; then
4- tsc --project tsconfig.build.json
4+ tsc --project tsconfig.build.json --emitDeclarationOnly
55 find lib -type f \( -name ' *.mjs*' -or -name ' *.mts*' \) -delete
6+ rollup --config --failAfterWarnings --environment CJS:true
67
78elif [[ $1 == ' --esm' ]]; then
89 if [[ ! -z $( git status --porcelain src) ]]; then
You can’t perform that action at this time.
0 commit comments