Skip to content

Commit

Permalink
build!: Transition to ESM as hybrid package (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
Eengineer1 authored and ankurdotb committed Apr 14, 2023
1 parent b5f5fed commit 73bc966
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
19 changes: 19 additions & 0 deletions jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/** @type {import('ts-jest/dist/types').JestConfigWithTsJest} */
module.exports = {
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
transform: {
// '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
// '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest`
'^.+\\.m?[tj]sx?$': [
'ts-jest',
{
useESM: true,
},
],
},
testEnvironment: 'node',
moduleDirectories: ['node_modules', 'src'],
modulePathIgnorePatterns: ["tests/testutils.test.ts"],
};
6 changes: 0 additions & 6 deletions jest.config.js

This file was deleted.

8 changes: 8 additions & 0 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "esnext", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */
"outDir": "build/esm", /* Redirect output structure to the directory. */
"target": "esnext", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */
}
}

0 comments on commit 73bc966

Please sign in to comment.