Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ jobs:
run: pnpm playwright install chromium
- name: run tests
run: pnpm test
- name: types
if: (${{ success() }} || ${{ failure() }})
run: pnpm check:types
- name: archive tests temp directory
if: failure()
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin-svelte/src/plugins/configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import { buildIdFilter, buildIdParser } from '../utils/id.js';
import { createCompileSvelte } from '../utils/compile.js';

// @ts-expect-error rolldownVersion
// @ts-ignore rolldownVersion
const { version: viteVersion, rolldownVersion } = vite;

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/vite-plugin-svelte/src/plugins/setup-optimizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { toESBuildError, toRollupError } from '../utils/error.js';
import { safeBase64Hash } from '../utils/hash.js';
import { normalize } from '../utils/id.js';
import * as vite from 'vite';
// @ts-expect-error not typed on vite
// @ts-ignore not typed on vite
const { rolldownVersion } = vite;

/**
Expand Down Expand Up @@ -42,7 +42,7 @@ export function setupOptimizer(api) {
// Currently, a placeholder as more information is needed after Vite config is resolved,
// the added plugins are patched in configResolved below
if (rolldownVersion) {
//@ts-expect-error rolldown types not finished
//@ts-ignore rolldown types not finished
optimizeDeps.rollupOptions = {
plugins: [
placeholderRolldownOptimizerPlugin(optimizeSveltePluginName),
Expand Down
10 changes: 6 additions & 4 deletions packages/vite-plugin-svelte/src/preprocess.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ const {
preprocessCSS,
resolveConfig,
transformWithEsbuild,
//@ts-expect-error rolldown types don't exist
//@ts-ignore rolldown types don't exist
rolldownVersion,
//@ts-expect-error rolldown types don't exist
//@ts-ignore rolldown types don't exist
transformWithOxc
} = vite;
/**
Expand Down Expand Up @@ -72,8 +72,10 @@ function viteScript() {
function viteScriptOxc() {
return {
async script({ attributes, content, filename = '' }) {
const lang = /** @type {string} */ (attributes.lang);
if (!supportedScriptLangs.includes(lang)) return;
if (typeof attributes.lang !== 'string' || !supportedScriptLangs.includes(attributes.lang)) {
return;
}
const lang = /** @type {'ts'} */ (attributes.lang);
const { code, map } = await transformWithOxc(content, filename, {
lang,
target: 'esnext'
Expand Down