File tree Expand file tree Collapse file tree 7 files changed +33
-100
lines changed
Expand file tree Collapse file tree 7 files changed +33
-100
lines changed Original file line number Diff line number Diff line change 1- import { config , defineConfig } from '@elbwalker/tsup' ;
1+ import {
2+ defineConfig ,
3+ buildModules ,
4+ buildBrowser ,
5+ buildES5 ,
6+ } from '@elbwalker/tsup' ;
27
38const globalName = 'Destination' ;
49
510export default defineConfig ( [
6- // Modules
7- {
8- ...config ,
9- dts : true ,
10- format : [ 'cjs' , 'esm' ] ,
11- sourcemap : true ,
12- } ,
13- // Browser
14- {
15- ...config ,
16- format : [ 'iife' ] ,
17- globalName,
18- outExtension ( ) {
19- return { js : `.browser.js` } ;
20- } ,
21- } ,
22- // ES5
23- {
24- ...config ,
25- format : [ 'iife' ] ,
26- globalName,
27- outExtension ( ) {
28- return { js : `.es5.js` } ;
29- } ,
30- target : 'es5' ,
31- } ,
11+ buildModules ( ) ,
12+ buildBrowser ( { globalName } ) ,
13+ buildES5 ( { globalName } ) ,
3214] ) ;
Original file line number Diff line number Diff line change 1- import { config , defineConfig } from '@elbwalker/tsup' ;
1+ import { defineConfig , buildModules , buildBrowser } from '@elbwalker/tsup' ;
22
33const globalName = 'Destination' ;
44
55export default defineConfig ( [
6- {
7- entry : [ 'src/index.ts' ] ,
6+ buildModules ( {
87 minify : false ,
9- dts : true ,
10- format : [ 'cjs' , 'esm' ] ,
118 sourcemap : false ,
12- } ,
13- {
14- ...config ,
15- format : [ 'iife' ] ,
9+ } ) ,
10+ buildBrowser ( {
1611 globalName,
17- outExtension ( ) {
18- return { js : `.browser.js` } ;
19- } ,
20- } ,
12+ } ) ,
2113] ) ;
Original file line number Diff line number Diff line change 1- import { config , defineConfig } from '@elbwalker/tsup' ;
1+ import { defineConfig , buildModules , buildBrowser } from '@elbwalker/tsup' ;
22
33const globalName = 'Destination' ;
44
55export default defineConfig ( [
6- {
7- entry : [ 'src/index.ts' ] ,
6+ buildModules ( {
87 minify : false ,
9- dts : true ,
10- format : [ 'cjs' , 'esm' ] ,
118 sourcemap : false ,
12- } ,
13- {
14- ...config ,
15- format : [ 'iife' ] ,
9+ } ) ,
10+ buildBrowser ( {
1611 globalName,
17- outExtension ( ) {
18- return { js : `.browser.js` } ;
19- } ,
20- } ,
12+ } ) ,
2113] ) ;
Original file line number Diff line number Diff line change 1- import { config , defineConfig } from '@elbwalker/tsup' ;
1+ import {
2+ defineConfig ,
3+ buildModules ,
4+ buildBrowser ,
5+ buildES5 ,
6+ } from '@elbwalker/tsup' ;
27
38const globalName = 'Source' ;
49
510export default defineConfig ( [
6- // Modules
7- {
8- ...config ,
9- dts : true ,
10- format : [ 'cjs' , 'esm' ] ,
11- sourcemap : true ,
12- } ,
13- // Browser
14- {
15- ...config ,
16- format : [ 'iife' ] ,
17- globalName,
18- outExtension ( ) {
19- return { js : `.browser.js` } ;
20- } ,
21- } ,
22- // ES5
23- {
24- ...config ,
25- format : [ 'iife' ] ,
26- globalName,
27- outExtension ( ) {
28- return { js : `.es5.js` } ;
29- } ,
30- target : 'es5' ,
31- } ,
11+ buildModules ( ) ,
12+ buildBrowser ( { globalName } ) ,
13+ buildES5 ( { globalName } ) ,
3214] ) ;
Original file line number Diff line number Diff line change 1- import { config , defineConfig } from '@elbwalker/tsup' ;
1+ import { buildModules , defineConfig } from '@elbwalker/tsup' ;
22
3- export default defineConfig ( [
4- // Modules
5- {
6- ...config ,
7- dts : true ,
8- format : [ 'cjs' , 'esm' ] ,
9- sourcemap : true ,
10- } ,
11- ] ) ;
3+ export default defineConfig ( [ buildModules ( ) ] ) ;
Original file line number Diff line number Diff line change 1- import { config , defineConfig } from '@elbwalker/tsup' ;
1+ import { buildModules , defineConfig } from '@elbwalker/tsup' ;
22
3- export default defineConfig ( [
4- {
5- ...config ,
6- dts : true ,
7- format : [ 'cjs' , 'esm' ] ,
8- sourcemap : true ,
9- } ,
10- ] ) ;
3+ export default defineConfig ( [ buildModules ( ) ] ) ;
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export default defineConfig([
2020 clean : false ,
2121 dts : true ,
2222 treeshake : true ,
23- // platform: 'browser',
23+ // platform: 'browser', // @TODO reactivate this
2424 } ) , // Core and Web files
2525 // Browser
2626 buildBrowser ( {
You can’t perform that action at this time.
0 commit comments