forked from getsentry/sentry-javascript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(node-profiling): Output ESM and remove Sentry deps from output (g…
…etsentry#11135) - Moves Sentry deps to `dependencies` rather than `devDependencies` - Updated `package.json` exports - Updated the rollup config to mirror our other modules with the addition of the commonJs plugin - I couldn't use `createRequire` myself because Jest can't handle `import.meta` so instead I used `@rollup/plugin-esm-shim` which shims both `require` and `__dirname` in `cpu_profiler.ts` in the ESM output!
- Loading branch information
1 parent
ed61ca6
commit 22eb7ce
Showing
6 changed files
with
50 additions
and
39 deletions.
There are no files selected for viewing
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
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,12 +1,12 @@ | ||
import commonjs from '@rollup/plugin-commonjs'; | ||
import resolve from '@rollup/plugin-node-resolve'; | ||
import typescript from '@rollup/plugin-typescript'; | ||
import { makeBaseNPMConfig } from '@sentry-internal/rollup-utils'; | ||
import esmshim from '@rollup/plugin-esm-shim'; | ||
import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollup-utils'; | ||
|
||
export default makeBaseNPMConfig({ | ||
packageSpecificConfig: { | ||
input: 'src/index.ts', | ||
output: { file: 'lib/index.js', format: 'cjs', dir: undefined, preserveModules: false }, | ||
plugins: [resolve(), commonjs(), typescript({ tsconfig: './tsconfig.json' })], | ||
}, | ||
}); | ||
export default makeNPMConfigVariants( | ||
makeBaseNPMConfig({ | ||
packageSpecificConfig: { | ||
output: { dir: 'lib', preserveModules: false }, | ||
plugins: [commonjs(), esmshim()], | ||
}, | ||
}), | ||
); |
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
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