Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

extensions object tells you what npm module to require

  • Loading branch information...
commit d4970eeac720f9a2f4abbe286189aaf0825a72b8 1 parent 1300d55
@andrewrk authored
Showing with 7 additions and 1 deletion.
  1. +3 −1 readme.md
  2. +4 −0 src/jspackage.co
View
4 readme.md
@@ -82,7 +82,9 @@ object:
```coffee
{extensions} = require 'jspackage'
extensions['.lua'] =
- compile: (code, options) -> lua.compile(code, bare: options.bare)
+ require: 'npm-lua-package'
+ compile: (code, options) ->
+ require('npm-lua-package').compile(code, bare: options.bare)
depend_re: /^--depend "(.+)"( bare)?$/gm
```
View
4 src/jspackage.co
@@ -172,11 +172,13 @@ export const compile = !(options, cb) ->
export const extensions =
'.coffee':
+ require: 'coffee-script'
compile: (code, options) ->
require('coffee-script').compile code, {options.bare}
depend_re: /^#depend "(.+)"( bare)?$/gm
'.js':
+ require: null
compile: (code, options) ->
if options.bare
code
@@ -185,11 +187,13 @@ export const extensions =
depend_re: /^\/\/depend "(.+)"( bare)?;?$/gm
'.co':
+ require: 'coco'
compile: (code, options) ->
require('coco').compile code, {options.bare}
depend_re: /^#depend "(.+)"( bare)?$/gm
'.ls':
+ require: 'LiveScript'
compile: (code, options) ->
require('LiveScript').compile code, {options.bare}
depend_re: /^#depend "(.+)"( bare)?$/gm
Please sign in to comment.
Something went wrong with that request. Please try again.