Skip to content

Instantly share code, notes, and snippets.

@littledian
Last active July 6, 2018 08:41
Show Gist options
  • Save littledian/802bfcd073f44cee2dcd237b12be2a4e to your computer and use it in GitHub Desktop.
Save littledian/802bfcd073f44cee2dcd237b12be2a4e to your computer and use it in GitHub Desktop.
module.exports = {
configureWebpack: config => {
if (process.env.NODE_ENV === 'development') {
config.devtool = 'eval-source-map'
}
config.output.devtoolModuleFilenameTemplate = info => {
let $filename = 'sources://' + info.resourcePath
if (info.resourcePath.match(/\.vue$/) && !info.identifier.match(/type=script/)) {
$filename = 'webpack-generated:///' + info.identifier + '?' + info.hash
}
return $filename
}
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