johannschopplich / kirbyup

🆙 Official bundler for Kirby Panel plugins
https://kirbyup.getkirby.com
MIT License
51 stars 3 forks source link

Feature request: kirbyup `--mode` CLI option #10

Closed iskrisis closed 2 years ago

iskrisis commented 2 years ago

Vite uses --mode production to set mode. kirbyup --mode silently fails for me.

I am also not sure how to get to the mode from kirbyup.config.js because import.meta.env is undefined.

I really just needed sourcemaps for development so i did it the old lame way

export default defineConfig({
  extendViteConfig: {
    build: {
      sourcemap: process.env.NODE_ENV == 'development' ? 'inline' : false
    }
  }
})

and using "NODE_ENV=development kirbyup src/panel/index.js --watch"

iskrisis commented 2 years ago

Sorry this is my unexperience with vite i mostly use esbuild but the vue situation is better with vite/kirbyup (kirby panel plugins).

There must be some way how to get the mode in the config i just don't know how.

iskrisis commented 2 years ago

Ha! For some reason the inline sourcemaps don't work properly anyway. I am not sure why but both Chrome and FF just error that they can't understand them. From what i found its some deeper issue with vite and browsers so probably not fixable by me. Hopefuly one day it starts to work :))

Cheers thanks for this @johannschopplich