Skip to content

Commit

Permalink
Add system to list of supported formats (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfolnovic authored and jaredpalmer committed Oct 11, 2019
1 parent 157bcee commit a99f216
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_modules
.rts2_cache_cjs
.rts2_cache_esm
.rts2_cache_umd
.rts2_cache_system
dist
tester
tester-react
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export interface TsdxOptions {
// JS target
target: 'node' | 'browser';
// Module format
format: 'cjs' | 'umd' | 'esm';
format: 'cjs' | 'umd' | 'esm' | 'system';
// Environment
env: 'development' | 'production';
// Path to tsconfig file
Expand Down
12 changes: 12 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,18 @@ function createBuildConfigs(
env: 'production',
input,
},
opts.format.includes('system') && {
...opts,
format: 'system',
env: 'development',
input,
},
opts.format.includes('system') && {
...opts,
format: 'system',
env: 'production',
input,
},
]
.filter(Boolean)
.map((options: TsdxOptions, index: number) => ({
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface TsdxOptions {
// JS target
target: 'node' | 'browser';
// Module format
format: 'cjs' | 'umd' | 'esm';
format: 'cjs' | 'umd' | 'esm' | 'system';
// Environment
env: 'development' | 'production';
// Path to tsconfig file
Expand Down
1 change: 1 addition & 0 deletions templates/basic/gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ node_modules
.rts2_cache_cjs
.rts2_cache_esm
.rts2_cache_umd
.rts2_cache_system
dist
1 change: 1 addition & 0 deletions templates/react/gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ node_modules
.rts2_cache_cjs
.rts2_cache_esm
.rts2_cache_umd
.rts2_cache_system
dist
2 changes: 1 addition & 1 deletion website/docs/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export interface TsdxOptions {
// JS target
target: 'node' | 'browser';
// Module format
format: 'cjs' | 'umd' | 'esm';
format: 'cjs' | 'umd' | 'esm' | 'system';
// Environment
env: 'development' | 'production';
// Path to tsconfig file
Expand Down

0 comments on commit a99f216

Please sign in to comment.