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

Not indented with @vue/cli-service version 4 #6

Open
janober opened this issue Jan 1, 2020 · 3 comments
Open

Not indented with @vue/cli-service version 4 #6

janober opened this issue Jan 1, 2020 · 3 comments

Comments

@janober
Copy link

janober commented Jan 1, 2020

As soon as @vue/cli-service version 4 gets used it does somehow not indent anymore. So be clear. Instead of it looking like this:

{
    "key1": "value1",
    "key2": "value2"
}

it looks like this:

{
"key1": "value1",
"key2": "value2"
}

The problem seems to be that in the span elements with the class json-tree-indent the content ( ) is missing for some reason.

Guess the author probably knows what causes the problem if he reads the breaking changes which can be found here:
https://github.com/vuejs/vue-cli/blob/dev/CHANGELOG.md

@jameswragg
Copy link

jameswragg commented Jan 29, 2020

Just hit the same issue & found this work-around: vuejs/vue#10485 (comment) hope it helps.

The underlying issue looks like its a bug in the Vue template compiler itself: vuejs/vue#11059

@KennethLindalen
Copy link

Try changing your vue.config.js file into this:

module.exports = {
    chainWebpack: config => {
        config.module
            .rule('vue')
            .use('vue-loader')
            .tap(args => {
                args.compilerOptions.whitespace = 'preserve'
            })
    }
}

Problem being in version 4 it does not preserve the whitespaces.

@myst729
Copy link
Owner

myst729 commented Jan 6, 2023

Hi guys, does this package work well with Vue 3.x now?

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

4 participants