diff --git a/.github/workflows/pkg-size.yml b/.github/workflows/pkg-size.yml new file mode 100644 index 0000000..3938ef4 --- /dev/null +++ b/.github/workflows/pkg-size.yml @@ -0,0 +1,26 @@ +name: Package Size Report + +on: + pull_request: + branches: + - main + +jobs: + pkg-size-report: + name: Package Size Report + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 16.x + cache: yarn + + - name: Package Size Report + uses: pkg-size/action@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 6df8d45..35edfef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [3.1.1](https://github.com/alexgorbatchev/eslint-import-resolver-typescript/compare/v3.1.0...v3.1.1) (2022-06-27) + + +### Bug Fixes + +* add conditionNames support ([#114](https://github.com/alexgorbatchev/eslint-import-resolver-typescript/issues/114)) ([c74fe0e](https://github.com/alexgorbatchev/eslint-import-resolver-typescript/commit/c74fe0e99d219e4a28348e833fc605664f02be18)) + ## [3.1.0](https://github.com/alexgorbatchev/eslint-import-resolver-typescript/compare/v3.0.0...v3.1.0) (2022-06-25) diff --git a/package.json b/package.json index 1ec5dbf..16306c9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint-import-resolver-typescript", - "version": "3.1.0", + "version": "3.1.1", "type": "module", "description": "TypeScript .ts .tsx module resolver for `eslint-plugin-import`.", "repository": "https://github.com/alexgorbatchev/eslint-import-resolver-typescript", diff --git a/src/index.ts b/src/index.ts index af837e1..ff85772 100644 --- a/src/index.ts +++ b/src/index.ts @@ -55,6 +55,16 @@ const defaultMainFields = [ 'main', ] +const defaultConditionNames = [ + 'types', + 'import', + 'require', + 'node', + 'node-addons', + 'browser', + 'default', +] + export const interfaceVersion = 2 export interface TsResolverOptions @@ -63,6 +73,7 @@ export interface TsResolverOptions project?: string[] | string extensions?: string[] packageFilter?: (pkg: Record) => Record + conditionNamesMapper?: Record } const fileSystem = fs as FileSystem @@ -88,6 +99,7 @@ export function resolve( ...options, extensions: options?.extensions ?? defaultExtensions, mainFields: options?.mainFields ?? defaultMainFields, + conditionNames: options?.conditionNames ?? defaultConditionNames, fileSystem, useSyncFileSystemCalls: true, }