Giter Club home page Giter Club logo

Comments (19)

phated avatar phated commented on July 30, 2024

You will need to use the basePath option to keep the directory structure, as such:

html: {
  files: {
    'app/public/': ['app/views/**/*.jade']
  },
  options: {
    client: false,
    basePath: 'app/views/'
  }
}

from grunt-jade.

Siyfion avatar Siyfion commented on July 30, 2024

I just tried:

jade: {
  html: {
    files: {
      'public/': ['views/**/*.jade']
    },
    options: {
      client: false,
      basePath: 'views/'
    }
  }
}

And got:

Running "jade:html" (jade) task
Warning: Unable to write "public/" file (Error code: EISDIR). Use --force to continue.

from grunt-jade.

phated avatar phated commented on July 30, 2024

I just verified that is is working correctly. Try removing your public/ directory.

from grunt-jade.

Siyfion avatar Siyfion commented on July 30, 2024

Nope, just tried creating a new directory called blah and I get exactly the same error.

from grunt-jade.

phated avatar phated commented on July 30, 2024

Some kind of configuration on your system is incorrect because I ran you example on my development machine and it worked.

from grunt-jade.

Siyfion avatar Siyfion commented on July 30, 2024

Hmm... Is this a Windows / Mac / Linux machine you're testing on? (I'm running Windows)

from grunt-jade.

sononix avatar sononix commented on July 30, 2024

Mhh I trying a yeoman build using grunt and jade and I can verify I cant get this snippet to spit out any thing

jade: {
html: {
files: {
'<%= yeoman.app %>/.html': ['<%= yeoman.app %>/jade/.jade']
},
options: {
client: false,
basePath: '<%= yeoman.app %>'
}
}
},

the problem is that the wildcard is also carried through to the output file name so a file name *.html is generated
If I use

jade: {
html: {
files: {
'<%= yeoman.app %>/': ['<%= yeoman.app %>/jade/*.jade']
},
options: {
client: false,
basePath: '<%= yeoman.app %>'
}
}
},

it all generates an error of failing to be able to write to file

Running "jade:html" (jade) task
Warning: Unable to write "app/" file (Error code: EISDIR). Use --force to continue.

from grunt-jade.

phated avatar phated commented on July 30, 2024

@sononix - I believe your first part is a separate issue, as I don't support that (and don't believe I have it anywhere in docs or tests).

@Siyfion - I have tested on Linux and Mac but I am using internal grunt functions so it should be as cross-platform compatible as grunt itself.

from grunt-jade.

sononix avatar sononix commented on July 30, 2024

I finally found some doc's the solution i found that worked was

jade: {
dist: {
options: {
pretty: true
},
files: [{
expand: true,
cwd: '<%= yeoman.app %>/jade',
dest: '<%= yeoman.app %>',
src: '*.jade',
ext: '.html'
}]
}
},

from grunt-jade.

phated avatar phated commented on July 30, 2024

Interesting, I will explore why that is the case. (I am assuming you are on Windows also, @sononix?)

I just recently upgrade computers and haven't gotten a Windows VM running yet to test anything on. Any more information will help.

from grunt-jade.

sononix avatar sononix commented on July 30, 2024

Running mac and Im running yeoman v1 not sure what the other dependencies are

I found the snippet here
https://gist.github.com/kevva/5201657

here is my package.json file
{
"name": "testingapp",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {
"grunt": "0.4.0rc7",
"grunt-contrib-copy": "0.4.0rc7",
"grunt-contrib-concat": "0.1.2rc6",
"grunt-contrib-coffee": "0.4.0rc7",
"grunt-contrib-uglify": "0.1.1rc6",
"grunt-contrib-compass": "0.1.1rc8",
"grunt-contrib-jshint": "0.1.1rc6",
"grunt-contrib-mincss": "0.4.0rc7",
"grunt-contrib-connect": "0.1.1rc6",
"grunt-contrib-clean": "0.4.0rc6",
"grunt-contrib-htmlmin": "0.1.1rc7",
"grunt-contrib-imagemin": "0.1.1rc8",
"grunt-contrib-livereload": "0.1.0rc8",
"grunt-bower-hooks": "~0.2.0",
"grunt-usemin": "~0.1.7",
"grunt-regarde": "~0.1.1",
"grunt-karma": "~0.3.0",
"grunt-open": "~0.1.0",
"matchdep": "~0.1.1",
"grunt-google-cdn": "~0.1.0",
"grunt-ngmin": "~0.0.1",
"grunt-contrib-jade": "~0.5.0"
},
"engines": {
"node": ">=0.8.0"
}
}

from grunt-jade.

phated avatar phated commented on July 30, 2024

@sononix some of the Grunt RCs broke APIs. I suggest updating anything that is an RC to a release version. I feel like Grunt 0.4.0rc7 was particularly bad.

from grunt-jade.

Siyfion avatar Siyfion commented on July 30, 2024

I just did an npm update and I'm still getting the issue; is there something I can do to help diagnose my issue? Or something that'll narrow it down?

from grunt-jade.

phated avatar phated commented on July 30, 2024

npm update won't solve the problem with @sononix package.json, as yeoman locked grunt in to 0.4.0rc7 which means he will have to go into the package.json and edit the specific task dependencies.

Is this your same use case @Siyfion? What does your package.json look like?

from grunt-jade.

Siyfion avatar Siyfion commented on July 30, 2024
{
  "dependencies": {
    "async": "*",
    "express": "*",
    "jade": "*",
    "mongoose": "*",
    "validator": "*",
    "winston": "*",
    "sugar": "*",
    "password-hash": "*",
    "pdfkit": "*"
  },
  "engines": {
    "node": "0.8.x",
    "npm": "1.1.x"
  },
  "devDependencies": {
    "grunt": "~0.4.1",
    "grunt-contrib-jade": "~0.5.0",
    "grunt-contrib-jshint": "~0.3.0"
  }
}

from grunt-jade.

phated avatar phated commented on July 30, 2024

@Siyfion your issues aren't related to grunt version. I am guessing your problems are related to Windows as none of my stuff gets tested on it until someone reports it broken

from grunt-jade.

Siyfion avatar Siyfion commented on July 30, 2024

@phated Is there anything that I can do to help from my end?

from grunt-jade.

phated avatar phated commented on July 30, 2024

@Siyfion I just realized that you are using grunt-contrib-jade, and not this library. I suggest you bring it up with the maintainers of grunt-contrib-jade or switch to using this plugin, which is just grunt-jade.

Note: I just tested my library on Windows and it works fine. 2 tests fail due to newlines in windows, but running just the jade task generates all the files specified.

from grunt-jade.

Siyfion avatar Siyfion commented on July 30, 2024

Apologies @phated, I didn't even notice the subtle difference in name. I've brought the same issue up with grunt-contrib crowd.

from grunt-jade.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.