Commit cc55c44
authored
fix(typescript): allow for files to be nested in folders within outDir (#1783)
fix(typescript): allow for files to be nested within outDir
This change corrects a regression introduced by #1728, preventing dual bundle configs from writing output files to directories nested within the directory defined in the tsconfig's outDir property.
Example:
```js
export default {
input: 'src/index.ts', // Replace with the path to your entry TypeScript file
output: [
{
dir: 'dist/cjs',
format: 'cjs',
sourcemap: true,
preserveModules: true
},
{
dir: 'dist/esm',
format: 'esm',
sourcemap: true,
preserveModules: true
}
],
plugins: [
json(),
resolve(),
commonjs(),
typescript({
tsconfig: 'tsconfig.json',
compilerOptions: {
/* Basic Options */
target: 'ES5',
module: 'ES2020',
lib: ['ES2019', 'ES2020'],
allowJs: true,
checkJs: false,
/* Strict Type-Checking Options */
strict: true,
/* Module Resolution Options */
moduleResolution: 'node',
esModuleInterop: true,
/* Advanced Options */
forceConsistentCasingInFileNames: true,
skipDefaultLibCheck: true,
skipLibCheck: true,
outDir: path.join(__dirname, 'dist')
}
})
],
external: deps // Add any external dependencies you don't want to bundle
};
```1 parent 4799541 commit cc55c44
2 files changed
+37
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
67 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
68 | 71 | | |
69 | 72 | | |
70 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
132 | 162 | | |
133 | 163 | | |
134 | 164 | | |
| |||
0 commit comments