Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

productionSourceMap not built #84

Open
JohannesLamberts opened this issue Mar 15, 2019 · 1 comment
Open

productionSourceMap not built #84

JohannesLamberts opened this issue Mar 15, 2019 · 1 comment

Comments

@JohannesLamberts
Copy link

Client-source maps are never built in production mode:

webpackConfig.devtool(!isProd ? '#cheap-module-source-map' : undefined)

vue.config.js includes a productionSourceMap option, that is true by default.:
https://cli.vuejs.org/config/#productionsourcemap

IMHO it should be considered as in
https://github.com/vuejs/vue-cli/blob/2cf5849222db24ce5c3b5607513f32ac79a476a7/packages/%40vue/cli-service/lib/config/prod.js#L13

version: @akryum/[email protected]

@phil294
Copy link

phil294 commented Mar 16, 2020

I can confirm this still doesnt work. But you can at least easily workaround it by setting devtool manually in your vue.config.js:

module.exports = {
  // productionSourceMap: true, // doesnt work currently
  chainWebpack: (config) => {
    config
      .devtool('source-map')
  }
}

Edit: If you do this, you'll get a very ugly error in production build (when going to a subroute on first request): vuejs/vue#9488. Because of this, you will also need

 css: {
    extract: true,
    sourceMap: true,
  }

in your vue.config.js, so the css mappings are also generated. Not sure if the extract: true is really necessary though.

And if you're getting a (node:183200) UnhandledPromiseRejectionWarning: ReferenceError: document is not defined error, you are probably disabling criticalCSS which again fails with this... but I adressed this in #186

Good thing I didnt just lose 5 hours on this :-/
Great plugin nevertheless, very useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants