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

Aliases doesn't work with mkdist builder #375

Open
RIP21 opened this issue Mar 10, 2024 · 0 comments
Open

Aliases doesn't work with mkdist builder #375

RIP21 opened this issue Mar 10, 2024 · 0 comments

Comments

@RIP21
Copy link

RIP21 commented Mar 10, 2024

Environment

Node: v20.11.0
Unbuild: 2.0.0

Reproduction

Config

import * as path from 'node:path'
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
  entries: [
    {
      builder: 'mkdist',
      input: './lib',
      outDir: './dist',
      pattern: ['**/*', '!**/*.test.{ts,tsx}', '!**/*/__tests__/**'],
      ext: 'js',
      format: 'esm',
      rootDir: '.',
    },
  ],
  alias: {
    '@lib': path.resolve(__dirname, 'lib'),
  },
  outDir: './dist',
  declaration: true,
})

Put two files into lib folder and then a reference from one another using path aliases like @lib/anyFile

Describe the bug

When using the config mentioned above, all the path aliases fail to be replaced with correct relative paths while command succeeds (there is no error messages)

Expected:
Specified aliases are replaced with relative paths in the resulting files

Actual:
They're kept untouched

Additional context

No response

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant