Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Mar 26, 2024
1 parent 1050d69 commit 0d48436
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
16 changes: 7 additions & 9 deletions packages/vite/src/compat-styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { join } from 'path';
import { existsSync } from 'fs';

export function compatScss() {

const resolverLoader = new ResolverLoader(process.cwd());

const pathsImporter = () => {
Expand All @@ -29,23 +28,22 @@ export function compatScss() {
}
if (existsSync(newPath)) {
return {
file: newPath
file: newPath,
};
}
}
return null
return null;
}
return (url: string, _prev: any, done: any) => {
search(url).then(done).catch(() => done(null));
search(url)
.then(done)
.catch(() => done(null));
};
};

return {
alias: [],
importer: [pathsImporter()],
includePaths: [
process.cwd(),
join(process.cwd(), 'node_modules'),
],
}
includePaths: [process.cwd(), join(process.cwd(), 'node_modules')],
};
}
2 changes: 1 addition & 1 deletion tests/scenarios/vite-app-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ viteAppScenarios
.my-style {
color: blue
}
`
`,
},
},
});
Expand Down
8 changes: 4 additions & 4 deletions tests/vite-app/vite.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
templateTag,
optimizeDeps,
compatPrebuild,
compatScss
compatScss,
} from "@embroider/vite";
import { resolve } from "path";
import { babel } from "@rollup/plugin-babel";
Expand Down Expand Up @@ -36,9 +36,9 @@ export default defineConfig({
}),
],
css: {
preprocessorOptions: {
scss: compatScss(),
},
preprocessorOptions: {
scss: compatScss(),
},
},
optimizeDeps: optimizeDeps(),
server: {
Expand Down

0 comments on commit 0d48436

Please sign in to comment.