Skip to content

Commit

Permalink
sourceMaps only for dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Zn4rK committed Oct 18, 2024
1 parent 00b16e9 commit 0570ac4
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/vite-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,17 @@ export function navita(options?: Options) {
let lastCssContent: string | undefined;
let context: string;
let isSSR = false;
let isDEV = true;

return {
enforce: "pre",
name: "navita",
config(_, env) {
isDEV = env.command === 'serve';

return {
optimizeDeps: {
include: env.command === 'serve' ? ['@navita/css'] : [],
include: isDEV ? ['@navita/css'] : [],
},
ssr: {
external: [
Expand All @@ -58,9 +61,8 @@ export function navita(options?: Options) {
}

const defaultEngineOptions = {
// Only for development ?
enableSourceMaps: true,
enableDebugIdentifiers: true,
enableSourceMaps: isDEV,
enableDebugIdentifiers: isDEV,
...(options?.engineOptions || {}),
};

Expand Down

0 comments on commit 0570ac4

Please sign in to comment.