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

Typescript checker doesn't abort build when it's failed #431

Open
leandrocm86 opened this issue Jan 26, 2025 · 0 comments
Open

Typescript checker doesn't abort build when it's failed #431

leandrocm86 opened this issue Jan 26, 2025 · 0 comments

Comments

@leandrocm86
Copy link

I've read the docs and other similar issues, and I don't know if I misunderstood something, but it seems that building with vite should only be done if the checking is okay. However, I've notice the files are being outputted before the check fails with errors:

l86@l86-nuc:/home/l86/html:06:48:43$ vite build compras2 --outDir dist
vite v6.0.11 building for production...
✓ 12 modules transformed.
dist/assets/x-mark-3-256-khpv3xiB.png   7.68 kB
dist/lista.html                        10.01 kB │ gzip: 2.47 kB
dist/assets/app-DaimroVj.css            2.46 kB │ gzip: 0.77 kB
dist/assets/app-CKPhTqJk.js            18.80 kB │ gzip: 6.74 kB
✓ built in 3.11s
compras2/lista.ts:56:25 - error TS2653: Non-abstract class expression does not implement inherited abstract member 'render' from class 'DynamicTag'.
56 const cadastroTag = new class extends DynamicTag {
                           ~~~~~
compras2/lista.ts:60:24 - error TS4117: This member cannot have an 'override' modifier because it is not declared in the base class 'DynamicTag'. Did you mean 'render'?
60     protected override rende() {
                          ~~~~~
Found 2 errors in the same file, starting at: compras2/lista.ts:56

This is my current vite.config.js (inside the compras2 project folder):

import { defineConfig } from 'vite'
import checker from 'vite-plugin-checker'

export default defineConfig({
  build: {
    target: 'esnext',
    rollupOptions: {
      input: {
        app: './compras2/lista.html',
      },
    },
  },
  plugins: [
    checker({
      typescript: true,
    })
  ]
})

Did I misunderstood something or isn't this the expected behavior? Is there anything I can do so errors are checked before the files are overridden in the dist folder?

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