Comparing version 1.9.0 to 1.10.0
@@ -8,2 +8,3 @@ // get the config and package and stuff | ||
import validDialects from './valid-dialects.js'; | ||
import validExclude from './valid-exclude.js'; | ||
import validExports from './valid-exports.js'; | ||
@@ -25,2 +26,3 @@ import validExtraDialects from './valid-extra-dialects.js'; | ||
(e.project === undefined || validProject(e.project)) && | ||
(e.exclude === undefined || validExclude(e.exclude)) && | ||
validExtraDialects(e) && | ||
@@ -42,2 +44,3 @@ validBoolean(e, 'selfLink') && | ||
validImports(pkg); | ||
pkg.tshy = tshy; | ||
if (tshy.exports) | ||
@@ -54,3 +57,2 @@ return tshy; | ||
} | ||
pkg.tshy = tshy; | ||
tshy.exports = e; | ||
@@ -57,0 +59,0 @@ return tshy; |
@@ -11,3 +11,4 @@ import chalk from 'chalk'; | ||
import preventVerbatimModuleSyntax from './prevent-verbatim-module-syntax.js'; | ||
const { dialects = ['esm', 'commonjs'], esmDialects = [], commonjsDialects = [], } = config; | ||
const { dialects = ['esm', 'commonjs'], esmDialects = [], commonjsDialects = [], exclude = [], } = config; | ||
const relativeExclude = exclude.map(e => `../${e}`); | ||
const recommended = { | ||
@@ -43,3 +44,3 @@ compilerOptions: { | ||
const commonjs = (dialect) => { | ||
const exclude = ['../src/**/*.mts']; | ||
const exclude = [...relativeExclude, '../src/**/*.mts']; | ||
for (const [d, pf] of polyfills) { | ||
@@ -63,3 +64,3 @@ if (d === dialect) | ||
const esm = (dialect) => { | ||
const exclude = []; | ||
const exclude = [...relativeExclude]; | ||
for (const [d, pf] of polyfills) { | ||
@@ -75,3 +76,3 @@ if (d === dialect) | ||
include: ['../src/**/*.ts', '../src/**/*.mts', '../src/**/*.tsx'], | ||
exclude, | ||
exclude: exclude, | ||
compilerOptions: { | ||
@@ -78,0 +79,0 @@ outDir: '../.tshy-build/' + dialect, |
@@ -10,2 +10,3 @@ import type { ConditionalValue, ExportsSubpaths, Imports } from 'resolve-import'; | ||
project?: string; | ||
exclude?: string[]; | ||
}; | ||
@@ -12,0 +13,0 @@ export type Dialect = 'commonjs' | 'esm'; |
{ | ||
"name": "tshy", | ||
"version": "1.9.0", | ||
"version": "1.10.0", | ||
"description": "TypeScript HYbridizer - Hybrid (CommonJS/ESM) TypeScript node package builder", | ||
@@ -5,0 +5,0 @@ "author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)", |
@@ -571,2 +571,16 @@ # tshy - TypeScript HYbridizer | ||
## Excluding Files Entirely From All Builds | ||
If you want to keep some files from being processed by tshy's | ||
builds entirely, you can add an `exclude` `string[]` field to the | ||
`tshy` object in `package.json`. For example: | ||
```json | ||
{ | ||
"tshy": { | ||
"exclude": ["src/**/*.test.ts"] | ||
} | ||
} | ||
``` | ||
## Other Targets: `browser`, `deno`, etc. | ||
@@ -573,0 +587,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
173807
143
1353
836