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

File extension not supported #2

Open
jescalan opened this issue Aug 22, 2014 · 2 comments
Open

File extension not supported #2

jescalan opened this issue Aug 22, 2014 · 2 comments

Comments

@jescalan
Copy link

Perhaps I'm doing something wrong here -- I'm trying to use a gulp plugin to compile jade, but alas duo is telling me that this file type is not supported.

The folder structure of the project:

.
├── app.coffee
├── index.jade
└── package.json

Code in app.coffee, which is the point from which I'm running duo:

Duo    = require 'duo'
gulp   = require 'duo-gulp'
accord = require 'gulp-accord'

duo = Duo(__dirname)
  .entry('index.jade')
  .use(gulp(accord)('jade'))

duo.run (err, src) ->
  if err then return console.error(err.stack)
  console.log src

The jade file is just a generic hello world, and package.json also generic with just the packages referenced above installed. When I execute app.coffee, I get this error back:

Error: index.jade: ".jade" not supported
  at error (/Users/jeff/Desktop/duo-test/node_modules/duo/lib/duo.js:986:10)
  at Duo.callee$0$2$ (/Users/jeff/Desktop/duo-test/node_modules/duo/lib/duo.js:474:13)
  at Empty.invoke (evalmachine.<anonymous>:148:31)
  at Duo.next (/Users/jeff/Desktop/duo-test/node_modules/duo/node_modules/co/index.js:74:21)
  at Duo.<anonymous> (/Users/jeff/Desktop/duo-test/node_modules/duo/node_modules/co/index.js:93:18)
  at Object._onImmediate (/Users/jeff/Desktop/duo-test/node_modules/duo/node_modules/co/index.js:52:14)
  at processImmediate [as _immediateCallback] (timers.js:336:15)

Halp!

@matthewmueller
Copy link
Contributor

So Duo needs to know that the file type has changed. When you compile index.jade, it will need to become index.js in order for Duo to continue building.

duo-gulp changes the file type here: https://github.com/duojs/gulp/blob/master/index.js#L43 and it's based on File.path object in gulp.

I have a feeling the plugin doesn't update the file path, so Duo has no way of knowing that it's now working with JS.

@jescalan
Copy link
Author

Yeah I don't think it does change the file path. This is something that has to be done in the gulp plugin? Also this will compile it to .html not .js - does that matter?

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