Currently, I am working on a Vue CLI project. After setting up the project and making some development changes, my package.json file now includes:
package.json
"dependencies": {
"bootstrap": "^4.3.1",
"core-js": "^3.0.1",
"preload-it": "^1.2.2",
"register-service-worker": "^1.6.2",
"vue": "^2.6.10",
"vue-router": "^3.0.3",
"vuetify": "^1.5.14",
"vuex": "^3.1.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.7.0",
"@vue/cli-plugin-pwa": "^3.7.0",
"@vue/cli-service": "^3.7.0",
"fontello-cli": "^0.4.0",
"node-sass": "^4.9.0",
"sass-loader": "^7.1.0",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.2",
"vue-cli-plugin-vuetify": "^0.5.0",
"vue-template-compiler": "^2.5.21",
"vuetify-loader": "^1.2.2"
}
vue.config.js
module.exports = {
configureWebpack: {
devtool: process.env.NODE_ENV === 'development'
? 'inline-source-map'
: false,
},
css: {
sourceMap: process.env.NODE_ENV === 'development'
}
}
babel.config.js
module.exports = {
presets: [
[
'@vue/app',
{ useBuiltIns: 'entry' }
]
]
}
Despite these changes, there are still issues with generating sourcemaps for Vue files (although it works fine for scss files).
https://i.sstatic.net/YVSmk.png
When clicking on the href to the Vue component:
https://i.sstatic.net/TApCx.png
Note:
- Multiple versions of the same file in webpack://./
- Only part that is within < code > tags is visible in the source editor (this might be causing the issue)
- Files from mounted filesystem workspace are not being used
Here is how the original file looks like - it is editable via Chrome DevTools
Is there a way to fix this so that the element inspector tab (style) will provide the correct source target?
EDIT 1
Simplest setup:
Install Vue CLI (3.7)
Add my vue.config.js (to enable sourcemaps)
Run npm run serve
https://i.sstatic.net/8H3UW.png
EDIT 2
Same for Vue CLI 3.5
I have also created a repository with a test project, which is basically a startup project with my configuration. https://github.com/l00k/vue-sample
EDIT 3 Vue-cli github issue https://github.com/vuejs/vue-cli/issues/4029