Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
98 additions
and
18 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
packages/firestore/test/rollup/.idea/runConfigurations/mocha.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"extension": "ts", | ||
"require": "ts-node/register", | ||
"spec": "test.*ts", | ||
"timeout": 10000 | ||
"spec": "test/**/*.test.ts", | ||
"timeout": 60000 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,80 @@ | ||
import type { RollupOptions } from 'rollup'; | ||
import { nodeResolve } from '@rollup/plugin-node-resolve'; | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import json from '@rollup/plugin-json'; | ||
|
||
export default [ | ||
{ | ||
function browserCommonJsRollupOptions(): RollupOptions { | ||
return { | ||
input: 'index.cjs', | ||
output: { | ||
file: 'dist/index.browser.cjs', | ||
format: 'cjs' | ||
}, | ||
plugins: [commonjs(), nodeResolve({ browser: true })] | ||
}, | ||
{ | ||
}; | ||
} | ||
|
||
function browserESModuleRollupOptions(): RollupOptions { | ||
return { | ||
input: 'index.mjs', | ||
output: { | ||
file: 'dist/index.browser.mjs', | ||
format: 'es' | ||
}, | ||
plugins: [commonjs(), nodeResolve({ browser: true })] | ||
} | ||
] satisfies RollupOptions[]; | ||
}; | ||
} | ||
|
||
function browserEsm5RollupOptions(): RollupOptions { | ||
return { | ||
input: 'index.mjs', | ||
output: { | ||
file: 'dist/index.browser.esm5.mjs', | ||
format: 'es' | ||
}, | ||
plugins: [ | ||
commonjs(), | ||
nodeResolve({ browser: true, exportConditions: ['esm5'] }) | ||
] | ||
}; | ||
} | ||
|
||
function nodeCommonJsRollupOptions(): RollupOptions { | ||
return { | ||
input: 'index.cjs', | ||
output: { | ||
file: 'dist/index.node.cjs', | ||
format: 'cjs' | ||
}, | ||
plugins: [ | ||
json(), | ||
commonjs(), | ||
nodeResolve({ browser: false, exportConditions: ['node'] }) | ||
] | ||
}; | ||
} | ||
|
||
function nodeESModuleRollupOptions(): RollupOptions { | ||
return { | ||
input: 'index.mjs', | ||
output: { | ||
file: 'dist/index.node.mjs', | ||
format: 'es' | ||
}, | ||
plugins: [ | ||
json(), | ||
commonjs(), | ||
nodeResolve({ browser: false, exportConditions: ['node'] }) | ||
] | ||
}; | ||
} | ||
|
||
function* allRollupOptions(): Generator<RollupOptions> { | ||
yield browserCommonJsRollupOptions(); | ||
yield browserESModuleRollupOptions(); | ||
yield browserEsm5RollupOptions(); | ||
yield nodeCommonJsRollupOptions(); | ||
yield nodeESModuleRollupOptions(); | ||
} | ||
|
||
export default [...allRollupOptions()] satisfies RollupOptions[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters