Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(typescript): allow for files to be nested in folders within outDir #1783

Merged

Commits on Oct 10, 2024

  1. fix(typescript): allow for files to be nested within outDir

    This change corrects a regression introduced by rollup#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
    };
    ```
    michaelfaith committed Oct 10, 2024
    Configuration menu
    Copy the full SHA
    f58c790 View commit details
    Browse the repository at this point in the history