Skip to content

Commit

Permalink
Replace define with env as it is the same thing.
Browse files Browse the repository at this point in the history
- `env` is the same thing as `define` with `JSON.stringify`.
  • Loading branch information
aryaemami59 committed Jun 4, 2024
1 parent d9eb0c9 commit c30dc40
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default defineConfig((options): Options[] => {
reselect: 'src/index.ts'
},
sourcemap: true,
target: ['esnext'],
clean: true,
...options
}
Expand All @@ -29,7 +30,7 @@ export default defineConfig((options): Options[] => {
{
...commonOptions,
name: 'Modern ESM',
target: 'esnext',
target: ['esnext'],
format: ['esm'],
outExtension: () => ({ js: '.mjs' }),
dts: true
Expand All @@ -45,7 +46,7 @@ export default defineConfig((options): Options[] => {
},
format: ['esm'],
outExtension: () => ({ js: '.js' }),
target: 'es2017'
target: ['es2017']
},

// Meant to be served up via CDNs like `unpkg`.
Expand All @@ -56,8 +57,8 @@ export default defineConfig((options): Options[] => {
'reselect.browser': 'src/index.ts'
},
platform: 'browser',
define: {
'process.env.NODE_ENV': JSON.stringify('production')
env: {
NODE_ENV: 'production'
},
format: ['esm'],
outExtension: () => ({ js: '.mjs' }),
Expand All @@ -69,10 +70,10 @@ export default defineConfig((options): Options[] => {
entry: {
'reselect.development': 'src/index.ts'
},
define: {
'process.env.NODE_ENV': JSON.stringify('development')
env: {
NODE_ENV: 'development'
},
format: 'cjs',
format: ['cjs'],
outDir: './dist/cjs/',
outExtension: () => ({ js: '.cjs' })
},
Expand All @@ -82,10 +83,10 @@ export default defineConfig((options): Options[] => {
entry: {
'reselect.production.min': 'src/index.ts'
},
define: {
'process.env.NODE_ENV': JSON.stringify('production')
env: {
NODE_ENV: 'production'
},
format: 'cjs',
format: ['cjs'],
outDir: './dist/cjs/',
outExtension: () => ({ js: '.cjs' }),
minify: true,
Expand Down

0 comments on commit c30dc40

Please sign in to comment.