Jade Templates and Templates

I am successfully using the grunt-wiredep package to inject Bower components into my view markup, and now I am migrating views from HTML to Jade. However, when I run my build script the bower scripts are not injected into the page as they were when using HTML.

I changed the parameter src

to link index.jade

instead of index.html

. Any ideas why injection isn't working?

+3


source to share


2 answers


I had a similar problem, and looking at the regex, it wasn't clear enough what to enter. So I am just adding my solution for others having the same problem.

In the jade files, you must add :

  // bower:js
  // endbower

      



and not :<!-- bower:css -->

<!-- endbower -->

For a different file extension, search the wiredep github test folder .

+8


source


Make sure you are using the latest wiredep 1.8.5

, which adds Jade support.

Check out the documentation as well as the main reading which provides more options.



Update the following information with your own presentation structure.

wiredep: {

  target: {

    // Point to the files that should be updated when
    // you run `grunt wiredep`
    src: [
      'app/views/**/*.html',   // .html support...
      'app/views/**/*.jade',   // .jade support...
      'app/styles/main.scss',  // .scss & .sass support...
      'app/config.yml'         // and .yml & .yaml support out of the box!
    ],

    // Optional:
    // ---------
    options: {
      cwd: '',
      dependencies: true,
      devDependencies: false,
      exclude: [],
      fileTypes: {},
      ignorePath: '',
      overrides: {}
    }

  }

}

      

+1


source







All Articles