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

Vue-cli and CodeBlock #90

Closed
christian-nils opened this issue Oct 22, 2019 · 2 comments
Closed

Vue-cli and CodeBlock #90

christian-nils opened this issue Oct 22, 2019 · 2 comments

Comments

@christian-nils
Copy link
Contributor

Hi,

I spent some time on an issue that I had with my slides. I could not render correctly my code using the CodeBlock widgets.

I used the version 4 of Vue-CLI to create my project. Eagle.js (v.0.6.0) is installed as dependency via npm.

For instance, if I have the following code in my slide:

<template id="app" lang="pug">
  .eg-theme-agrume
    .eg-slideshow
      slide
        eg-code-block(lang="bash").
          git clone https://github.com/Zulko/eaglejs-demo.git
          cd eaglejs-demo
          npm install
          npm run dev
</template>

My slide will show
git clone https://github.com/Zulko/eaglejs-demo.git cd eaglejs-demo npm install npm run dev
instead of:

git clone https://github.com/Zulko/eaglejs-demo.git
cd eaglejs-demo
npm install
npm run dev

Apparently Vue-CLI team modified the options of whitespace from Vue-CLI v3 to v4. So you need to add in the vue.config.js file the following code (see vuejs/vue#10485 (comment)) to get the expected behavior:

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

I hope it helps.

@yaodingyd
Copy link
Collaborator

Thanks! Are you willing to do a PR? Add a FAQ section right before Contribute and add your issue link there?

@christian-nils
Copy link
Contributor Author

Ok, this was the first time I do a PR. So hopefully, it was correct and useful. Have a great day! And thanks for this library.

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