question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

build: add flag for source maps in production (for upload)

See original GitHub issue

Is your feature request related to a problem? Please describe. If I am was searching right, there currently is no way to instruct the build to generate source maps e.g. for uploading to Sentry. I am trying to workaround this via quasar build -d && upload.sh && quasar build

Describe the solution you’d like SOURCE_MAPS=true quasar build or quasar build --source-maps based on the strategy in the conf.

Describe alternatives you’ve considered

Additional context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
lmm-gitcommented, Nov 27, 2021

We are using a self-implemented fix by extending the webpack config to achieve a similar behavior like requested for Sentry integration. Would be nice if this could get officially supported.

// extendWebpack  in quasar.conf

if (process.env.SOURCE_MAPS === 'yes') {
  const sourceMapPlugin = new webpack.SourceMapDevToolPlugin({
    filename: 'sourcemaps/[file].map'
  })
  cfg.plugins.push(sourceMapPlugin)
}

// Create sentry release only in CI
if (process.env.SENTRY_UPLOAD === 'yes') {
  const SentryWebpackPlugin = require('@sentry/webpack-plugin')
  // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
  const sentryPluginInstance = new SentryWebpackPlugin({
    // sentry-cli configuration
    authToken: process.env.SENTRY_WEBPACK_AUTH_TOKEN,
    org: 'our_org',
    project: 'our_project',
    url: 'https://sentry.our.domain',
    // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
    release: process.env.RELEASE_NAME,
    stripCommonPrefix: true,
    rewrite: true,

    // webpack specific configuration
    include: cfg.output.path,
    ignore: ['node_modules', 'webpack.config.js', 'tests']
  })
  cfg.plugins.push(sentryPluginInstance)
}

The workaround @eljefedelrodeodeljefe described does not work for us as there are some changes to the source code/maps which make debugging hard when building it twice.

1reaction
hawkeye64commented, Mar 27, 2022

I am closing this (again) but tagging @rstoenescu to see if it should be reopened.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using JS source-maps in production - DEV Community ‍ ‍
Checkout to the actual prod state commit. And run prod build with source-maps flag on. Go to the sources tab in the dev...
Read more >
Advanced Features: Source Maps | Next.js
Next.js provides a configuration flag you can use to enable browser source map generation during the production build: // next.config.js module.exports ...
Read more >
Should I Use Source Maps in Production? | CSS-Tricks
I believe that with Sass, you don't even have to pass a flag for it in the command or anything because it produces...
Read more >
Source Maps - Rollbar Docs
With the use of our CLI tool, you can upload source maps to our servers just by specifying the path to the minified...
Read more >
Source Maps - SurviveJS
Inline source maps add the mapping data directly to the generated files. · Separate source maps emit the mapping data to separate source...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found