We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm building a production build with vite-plugin-dts v3.4.0 and i get an error.
It seems, that in line 101 of vite-plugin-dts/src/transform.ts
the argument aliases was set to undefined by vite config or other plugins and is not checked by the condition below.
aliases
undefined
... function transformAliasImport(filePath, content, aliases, exclude = []) { if (!aliases.length) return content; ...
I've forked this repo and fixed this line by
if (!aliases || !aliases.length)
and it works for my usecase.
Heres my vite.config.js
import multiInput from 'rollup-plugin-multi-input' import {assetDir, entryFileNames, processAssetFileNames, processChunkFileNames} from './config/assets.js' import dts from 'vite-plugin-dts' import {resolve} from 'path' /** @type {import('vite').UserConfig} */ export default { publicDir: 'static', assetsInclude: ['**/*.md', '**/*.svg'], build: { minify: true, assetsDir: assetDir, sourcemap: true, lib: { entry: './src/index.ts', formats: ['es'] // pure ESM package }, rollupOptions: { output: { entryFileNames: entryFileNames, assetFileNames: processAssetFileNames, chunkFileNames: processChunkFileNames }, external: [ 'lit', 'lit-element', 'lit-html', 'lit/html.js', 'lit/directives/class-map.js', 'lit/directives/if-defined.js', 'lit/directives/style-map.js', 'lit/directives/unsafe-html.js', 'lit/directives/unsafe-svg.js', 'lit/directives/repeat.js', 'lit/decorators.js', '@open-wc/testing-helpers', '@open-wc/testing' ], input: [ 'src/index.ts', 'src/components/**/index.ts', 'src/modules/**/index.ts', 'src/utilities/**/index.ts', 'src/internal/utils/**/index.ts', 'src/mixins/index.ts' ], plugins: [ multiInput(), dts({ outDir: 'dist', include: ['src'] }) ] }, commonjsOptions: { include: 'node_modules/**' }, dynamicImportVarsOptions: { include: ['src/**/*.(js|ts|svg)'] } }, test: { globals: true, environment: 'jsdom', setupFiles: ['./config/vitest-setup.ts'] } }
The text was updated successfully, but these errors were encountered:
fc51b68
No branches or pull requests
I'm building a production build with vite-plugin-dts v3.4.0 and i get an error.
It seems, that in line 101 of
vite-plugin-dts/src/transform.ts
the argument
aliases
was set toundefined
by vite config or other plugins and is not checked by the condition below.I've forked this repo and fixed this line by
and it works for my usecase.
Heres my vite.config.js
The text was updated successfully, but these errors were encountered: