8000 Vue-cli and CodeBlock · Issue #90 · Zulko/eagle.js · GitHub
[go: up one dir, main page]

Skip to content
Vue-cli and CodeBlock #90
@christian-nils

Description

@christian-nils

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0