mirror of
https://github.com/openglobus/openglobus.git
synced 2025-12-08 19:25:27 +00:00
Fixed debug step by step in dev mode
This commit is contained in:
parent
617391ce2c
commit
e2371242a8
@ -33,7 +33,7 @@ export default function forceTerserPlugin({ filePath }) {
|
|||||||
if (result.code && result.map) {
|
if (result.code && result.map) {
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
writeFile(filePath, result.code, 'utf-8'),
|
writeFile(filePath, result.code, 'utf-8'),
|
||||||
writeFile(mapPath, result.map, 'utf-8'),
|
writeFile(mapPath, result.map, 'utf-8'),
|
||||||
]);
|
]);
|
||||||
console.log(`✔ ${fileName} and ${mapFileName} regenerated with Terser`);
|
console.log(`✔ ${fileName} and ${mapFileName} regenerated with Terser`);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -7,6 +7,7 @@ import glsl from 'vite-plugin-glsl';
|
|||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url);
|
const __filename = fileURLToPath(import.meta.url);
|
||||||
const __dirname = path.dirname(__filename);
|
const __dirname = path.dirname(__filename);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {{ mode: 'development' | 'production' }} param0
|
* @param {{ mode: 'development' | 'production' }} param0
|
||||||
* @returns {import('vite').UserConfig}
|
* @returns {import('vite').UserConfig}
|
||||||
@ -31,10 +32,9 @@ export default function ({mode}: { mode: 'development' | 'production' }) {
|
|||||||
output: {
|
output: {
|
||||||
entryFileNames: `og.[format].js`,
|
entryFileNames: `og.[format].js`,
|
||||||
assetFileNames: `[name][extname]`,
|
assetFileNames: `[name][extname]`,
|
||||||
sourcemapExcludeSources: true,
|
sourcemapExcludeSources: !isDev,
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: !isDev ? [
|
||||||
// doesn't work for esm modules
|
|
||||||
terser({
|
terser({
|
||||||
compress: true,
|
compress: true,
|
||||||
mangle: true,
|
mangle: true,
|
||||||
@ -42,12 +42,12 @@ export default function ({mode}: { mode: 'development' | 'production' }) {
|
|||||||
comments: false
|
comments: false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
]
|
] : [] // important no plugins for development mode
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
glsl({
|
glsl({
|
||||||
include: [ // Glob pattern, or array of glob patterns to import
|
include: [
|
||||||
'**/*.glsl', '**/*.wgsl',
|
'**/*.glsl', '**/*.wgsl',
|
||||||
'**/*.vert', '**/*.frag',
|
'**/*.vert', '**/*.frag',
|
||||||
'**/*.vs', '**/*.fs'
|
'**/*.vs', '**/*.fs'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user