arboleya / coffee-toaster

Minimalist build system for CoffeeScript.
114 stars 23 forks source link

Defining `vendors` causes release path & filename to be ignored #31

Closed paulspringett closed 12 years ago

paulspringett commented 12 years ago

Using coffee-toaster@0.6.3, when I define my release path in toaster.coffee it works fine and builds to the correct place. However, when I define a list of vendor files I get the following output:

Compiled /path/to/sample-toaster-app/undefined @ 9:30:37

This undefined file does contain JavaScript, however it is not in the correct path or filename.

I have tried moving the vendor files to different places, and even defining an empty list of vendors - this still causes the error.

Are you able to duplicate? My toaster file looks like this:

# => SRC FOLDER
toast 'src/coffee'

  # EXCLUDED FOLDERS (optional)
  # exclude: ['src/coffee/background.coffee']

  # => VENDORS (optional)
  vendors: [
    'src/vendor/underscore.min.js',
    'src/vendor/backbone.js',
    'src/vendor/jquery.min.js'
  ]

  # => OPTIONS (optional, default values listed)
  # bare: false
  # packaging: true
  # expose: 'window'
  # minify: true

  # => HTTPFOLDER (optional), RELEASE / DEBUG (required)
  httpfolder: 'bookmarklet'
  release: 'build/bookmarklet/bookmarklet.js'
  debug: 'build/bookmarklet/bookmarklet-debug.js'
paulspringett commented 12 years ago

I found the cause of this issue. It was because the generated toaster.coffee file uses tab-based indentation whereas my editor was using soft-tabs (ie. spaces). It seems as though the mix of the two causes this undefined issue.

I've opened a pull request of fix this by changing the generated file's tabs to spaces. (You may well disagree with this!) See #32

Interestingly this seems like an issue that CoffeeScript issue

arboleya commented 12 years ago

@paulspringett Improved in 0.6.4 version.