quasarframework / quasar

Quasar Framework - Build high-performance VueJS user interfaces in record time
https://quasar.dev
MIT License
25.9k stars 3.51k forks source link

Sourcemaps for Sentry #14946

Closed steveatkoan closed 1 year ago

steveatkoan commented 1 year ago

What happened?

I want to generate separate .map files for sentry.io When I edit quasar.config.js and set build.sourcemap = true i get 'inline' maps because https://github.com/quasarframework/quasar/blob/dev/app-vite/lib/config-tools.js#L120 sets trueto 'inline'. The documentation says I can use true | 'inline' | 'hidden'. I want the behaviour of truebut cannot get it

I want to use source maps in production. Inline sourcemaps triple the size of each file, which make the download size a bit large for users. I'd prefer to use linked sourcemaps

What did you expect to happen?

as above. I want separate .map files for sentry but there is no way to configure quasar to generate them: my choices are none, hidden or inline

Reproduction URL

https://stackblitz.com/edit/quasarframework-wiiirz?file=quasar.config.js

How to reproduce?

install new quasar app edit quasar.config.ts set build.sourcemap = true run quasar build on the command line expect to see separate .map files actually see larger .js files with inline source maps

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite), SPA Mode

Platforms/Browsers

Chrome

Quasar info output

Operating System - Darwin(22.1.0) - darwin/x64
NodeJs - 18.12.1

Global packages
  NPM - 8.19.2
  yarn - 1.22.19
  @quasar/cli - 1.3.2
  @quasar/icongenie - Not installed
  cordova - Not installed

Important local packages
  quasar - 2.10.2 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app-vite - 1.1.3 -- Quasar Framework App CLI with Vite
  @quasar/extras - 1.15.6 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 3.2.41 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 4.1.5
  pinia - 2.0.23 -- Intuitive, type safe and flexible Store for Vue
  vuex - Not installed
  vite - 2.9.15 -- Native-ESM powered web dev build tool
  eslint - 8.25.0 -- An AST-based pattern checker for JavaScript.
  electron - Not installed
  electron-packager - Not installed
  electron-builder - Not installed
  register-service-worker - 1.7.2 -- Script for registering service worker, with hooks
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed

Quasar App Extensions
  @quasar/quasar-app-extension-testing-unit-jest - 3.0.0-alpha.10 -- A Quasar App Extension for running Jest tests
  @quasar/quasar-app-extension-testing-e2e-cypress - 4.2.2 -- A Quasar App Extension for Cypress e2e
  @quasar/quasar-app-extension-testing - 2.0.4 -- A Quasar App Extension for managing Test Harnesses

Networking
  Host - Steves-MacBook-Pro.local
  en0 - 192.168.1.6
  en7 - 192.168.1.90

Relevant log output

No response

Additional context

No response

glorat commented 1 year ago

Issue got duplicated at #14589 with similar fix. For those reading this and awaiting the PR, there is a workaround to set the config to true, which will get passed through to vite and generate separate sourcemaps

steveatkoan commented 1 year ago

For those who follow: I used a SourceMap header as a workaround https://docs.sentry.io/platforms/javascript/sourcemaps/troubleshooting_js/#verify-sourcemappingurl-is-present

aahmedramy1 commented 1 year ago

i am trying to do the same and cant quite figure it out, can you help show me what to do in my quasar.config file ? @steveatkoan