Skip to content

Instantly share code, notes, and snippets.

@aliustaoglu
Created April 5, 2020 06:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aliustaoglu/34abf32b865c1c942f0adb03059880c4 to your computer and use it in GitHub Desktop.
Save aliustaoglu/34abf32b865c1c942f0adb03059880c4 to your computer and use it in GitHub Desktop.
Vue Webpack Sourcemap
module.exports = {
lintOnSave: false,
configureWebpack: config => {
if (process.env.NODE_ENV === 'development') {
config.devtool = 'eval-source-map';
config.output.devtoolModuleFilenameTemplate = info =>
info.resourcePath.match(/\.vue$/) && !info.identifier.match(/type=script/) // this is change ✨
? `webpack-generated:///${info.resourcePath}?${info.hash}`
: `webpack-yourCode:///${info.resourcePath}`;
config.output.devtoolFallbackModuleFilenameTemplate = 'webpack:///[resource-path]?[hash]';
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment