Git Product home page Git Product logo

connect-assets's Introduction

connect-assets

Build Status Node version

Transparent file compilation and dependency management for Node’s connect framework in the spirit of the Rails asset pipeline.

What can it do?

connect-assets can:

  1. Serve .js.coffee (CoffeeScript) files as compiled .js
  2. Concatenate .js.coffee and .js together.
  3. Serve .css.styl (Stylus) as compiled .css
  4. Serve .css.less (Less) as compiled .css
  5. Serve .css.sass or .css.scss (SASS) as compiled .css
  6. Serve .jst.jade (Jade templates) as compiled JavaScript functions (be sure to include the Jade runtime — see below).
  7. Serve .jst.ejs as compiled JavaScript functions.
  8. Preprocess style.css.ejs and script.js.ejs with EJS — just append .ejs to any file.
  9. Serve files with a cache-control token and use a far-future expires header for maximum efficiency.
  10. Avoid redundant git diffs by storing compiled .js and .css files in memory rather than writing them to the disk when in development.

How do I use it?

First, install it in your project's directory:

npm install connect-assets

Also install any specific compilers you'll need, e.g.:

npm install coffee-script
npm install stylus
npm install less
npm install node-sass
npm install jade
npm install ejs

Then add this line to your app's configuration:

app.use(require("connect-assets")());

Finally, create an assets directory in your project and throw all assets compiled into JavaScript into /assets/js and all assets compiled into CSS into /assets/css.

Markup functions

connect-assets provides five global functions named js, jsInline, css, cssInline and assetPath. Use them in your views. They return the HTML markup needed to include the most recent version of your assets (or, the path to the asset), taking advantage of caching when available. For instance, in a Jade template, the code

!= css("normalize")
!= js("jquery")

(where != is Jade's syntax for running JS and displaying its output) results in the markup

<link rel="stylesheet" href="/css/normalize-[hash].css" />
<script src="/js/jquery-[hash].js"></script>

You can pass a Hash of special attributes to helper method css or js:

!= css("normalize", { 'data-turbolinks-track': true } })
!= js("jquery", { async: true })

Results in:

<link rel="stylesheet" href="/css/normalize-[hash].css" data-turbolinks-track />
<script src="/js/jquery-[hash].js" async></script>

The inline variants jsInline and cssInline write the contents straight into the tags, instead of linking. For example,

!= cssInline("normalize")
!= jsInline("jquery")

(where != is Jade's syntax for running JS and displaying its output) results in the markup

<style>[contents]</style>
<script>[contents]</script>

You can also reference image paths via the assetPath helper. First, you must specify the path to your images via the paths option e.g:

...

var assets = require('connect-assets');

app.use(assets({
  paths: [
    'assets/css',
    'assets/js',
    'assets/img'
  ]
}));

You can then use the assetPath helper in your Jade like so:

img(src="#{assetPath('image-name.png')}")

Would result in:

<img src="/assets/img/image-name-[hash].png">

Sprockets-style concatenation

You can indicate dependencies in your .js.coffee and .js files using the Sprockets-style syntax.

In CoffeeScript:

#= require dependency

In JavaScript:

//= require dependency

When you do so, and point the js function at that file, two things can happen:

  1. By default, you'll get multiple <script> tags out, in an order that gives you all of your dependencies.
  2. If you passed the build: true option to connect-assets (enabled by default when NODE_ENV=production), you'll just get a single tag, which will point to a JavaScript file that encompasses the target's entire dependency graph—compiled, concatenated, and minified (with UglifyJS).

If you want to bring in a whole folder of scripts, use //= require_tree dir instead of //= require file.

You can also indicate dependencies in your .css files using the Sprockets-style syntax.

/*= require reset.css */

body { margin: 0; }

See Mincer for more information.

Options

If you like, you can pass any of these options to the first parameter of the function returned by require("connect-assets"):

Option Default Value Description
paths ["assets/js", "assets/css"] The directories that assets will be read from, in order of preference.
helperContext global The object that helper functions (css, js, assetPath) will be attached to.
servePath "assets" The virtual path in which assets will be served over HTTP. If hosting assets locally, supply a local path (say, "assets"). If hosting assets remotely on a CDN, supply a URL: "http://myassets.example.com/assets".
precompile ["*.*"] An array of assets to precompile while the server is initializing. Patterns should match the filename only, not including the directory.
build dev: false; prod: true Should assets be saved to disk (true), or just served from memory (false)?
buildDir "builtAssets" The directory to save (and load) compiled assets to/from.
compile true Should assets be compiled if they don’t already exist in the buildDir?
bundle dev: false; prod: true Should assets be bundled into a single tag (when possible)?
compress dev: false; prod: true Should assets be minified? If enabled, requires uglify-js and csswring.
gzip false Should assets have gzipped copies in buildDir?
fingerprinting dev: false; prod: true Should fingerprints be appended to asset filenames?
sourceMaps dev: true; prod: false Should source maps be served?

Custom Configuration of Mincer

This package depends on mincer, which is quite configurable by design. Many options from mincer are not exposed through connect-assets in the name of simplicity.

As asset compliation happens immediately after connect-assets is initialized, any changes that affect the way mincer compiles assets should be made during initialization. A custom initialization function can be passed to connect-assets as a second argument to the function returned by require("connect-assets"):

app.use(require("connect-assets")(options, function (instance) {
  // Custom configuration of the mincer environment can be placed here
  instance.environment.registerHelper(/* ... */);
}));

CLI

connect-assets includes a command-line utility, connect-assets, which can be used to precompile assets on your filesystem (which you can then upload to your CDN of choice). From your application directory, you can execute it with ./node_modules/.bin/connect-assets [options].

Usage: connect-assets [-h] [-v] [-gz] [-ap] [-i [DIRECTORY [DIRECTORY ...]]]
                      [-c [FILE [FILE ...]]] [-o DIRECTORY]

Optional arguments:
  -h, --help            Show this help message and exit.
  -v, --version         Show program's version number and exit.
  -i [DIRECTORY [DIRECTORY ...]], --include [DIRECTORY [DIRECTORY ...]]
                        Adds the directory to a list of directories that
                        assets will be read from, in order of preference.
                        Defaults to 'assets/js' and 'assets/css'.
  -c [FILE [FILE ...]], --compile [FILE [FILE ...]]
                        Adds the file (or pattern) to a list of files to
                        compile. Defaults to all files with extensions. Only
                        include the left most extension (ex. main.css).
  -o DIRECTORY, --output DIRECTORY
                        Specifies the output directory to write compiled
                        assets to. Defaults to 'builtAssets'.
  -s PATH, --servePath PATH
                        The virtual path in which assets will be served
                        over HTTP. If hosting assets locally, supply a
                        local path (say, "assets"). If hosting assets
                        remotely on a CDN, supply a URL.
  -gz, --gzip
                        Enables gzip file generation, which is disabled by
                        default.
  -ap, --autoprefixer   Enables autoprefixer during compilation.
  -sm, --sourceMaps     Enables source map generation for all files.
  -emc, --embedMappingComments
                        Embed source map url into compiled files.
  -nsmp, --noSourceMapProtection
                        Do not add XSSI protection header to source map files.
                        https://github.com/adunkman/connect-assets/issues/345#issuecomment-235246691

CLI examples

Basic use case: Compile contents of public/javascripts folder, saving to a the cdn directory. connect-assets -i public/javascripts -o cdnassets

Advanced use case (nested directories): When compiling files which use Sprockets style concatenation e.g. //= require dependency, the path to the dependency must also be passed using the --include flag. Consider this project structure:

Simple App
│   README.md
│   app.js
└─── public
│   │   robots.txt
│   └─── javascripts
│       │   bundle.js
│       │   sw.js
|       |   client.js
│       └───  app
|               └───  users
│                   |  users.controller.js
│                   |  users.routes.js
└─── test
    │   users.spec.js

Contents of bundle.js:

//= require users/users.controller.js
//= require users/users.routes.js

In the above scenario connect-assets -i public/javascripts -o cdnassets will fail to compile bundle.js as connect-assets will fail to find the file on the provided path. To remove errors, ensure that the paths (the same paths as what are defined in your connect-assets options). For example, connect-assets -i public/javascripts -i public/javascripts/app -o cdnassets will successfully pre-compile bundle.js.

Serving Assets from a CDN

The CLI utility precompiles assets supplied into their production-ready form, ready for upload to a CDN or static file server. The generated manifest.json is all that is required on your application server if connect-assets is properly configured. Once assets have been precompiled and uploaded to CDN (perhaps as part of your build process), you can pass the Mincer environment your manifest file like so:

const assetManifest = require('./manifest.json');

app.use(require("connect-assets")(options, function (instance) {
  instance.manifest = assetManifest;
}));

Your CDN url will also need to be passed to the servePath option of connect-assets.

Credits

Follows in the footsteps of sstephenson's Sprockets, through the Mincer project.

Take a look at the contributors who make this project possible.

connect-assets's People

Contributors

acruikshank avatar adunkman avatar alexkravets avatar arthanzel avatar augnustin avatar blakevanlan avatar cgc avatar codynguyen avatar dapriett avatar dustyburwell avatar elliotf avatar freewil avatar iamjochem avatar iangreenleaf avatar j avatar jasonmanners avatar jbpros avatar jonbca avatar js-kyle avatar korzhyk avatar maxnordlund avatar netsgnut avatar nimietist avatar reaktivo avatar robconery avatar scottty881 avatar sebastianhoitz avatar tarkus avatar tikotzky avatar trevorburnham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

connect-assets's Issues

options.src not working as expected

This issue looks similar to https://github.com/TrevorBurnham/connect-assets/issues/23 , so please forgive me if there is overlap.

I am working on a fairly large project (https://github.com/Postmedia/timbits-example) that uses connect-assets. It seems the update to 2.1.0 has breaking changes and I am trying to find a suitable workaround. I was previously working with version 2.0.0-rc1 without issue. My working code that I was using with 2.0.0-rc1 was (yes, I was using it to serve dynamic data from two different directories):

assets = require 'connect-assets'

@server.use assets({src:"#{process.cwd()}/public"})
@server.use assets({src:"#{process.cwd()}/views"})

Let's say /public/template/story.coffee exists.

On 2.0.0-rc1 my requests to both /public/template/story.coffee and /public/template/story.js are successful.

However, on 2.1.0, both requests for /public/template/story.coffee and /public/template/story.js fail

Similarly, I am having trouble running your tests (but this may be unrelated).

Using 2.0.0-rc1, when I run /test/test.coffee and then visit http://localhost:3588/js/a.js in a browser I get javascript (success).

Using 2.1.0, when I run /test/DevelopmentIntegration.coffee (I notice /test/test.coffee has been removed) and then hit http://localhost:3588/js/a.js I get "Cannot GET /js/a.js"

Thoughts? Thanks in advance.

Support for cluster?

I don't know if anyone has been succeeded in using connect-assets with cluster. When I tried, I got 404 error for my assets js! The css files can be surprisingly loaded without any problems. I have only tested local.

The problems may be caused by how the js cached? If I typed in the url to the js-files manually, they can be loaded. I think it's because the workers cannot find the generated js-files which were created by other workers.

Provide way to save production-mode JS and CSS to disk

So, in production mode, you get a compiled, concatenated, minified JS file (and a compiled CSS file, if you're using Stylus), but they're just stored in memory. Obviously that's unacceptable for many applications—you might want to use a CDN, or just be able to deploy to a server that doesn't have CoffeeScript and Stylus installed. The question is, how to make those built files available?

(To use those files in production mode, you could set js.root and css.root to URLs, making connect-assets just pass those paths through directly. That won't work with the MD5 hashes, though. Maybe those should be saved in a configuration file in the build dir as well.)

stylus @import-ed dependencies don't reload

Great port. Coffeescript and Stylus is everything I need. I've tried to write it by myself.
Unfortunately, as in title, I found that stylus dependencies don't reload after change. Is it possible to force recompiling in development mode?

Providing custom functions for Stylus

Stylus allows you to define javascript functions that can be invoked during the processing of your style files. I'm not seeing anyway of passing those custom functions into connect-asset that will then bind them to the Stylus compiler. I can provide my own cssCompiler implementation and use the 'define' function that Stylus provides to accomplish what I need but it would be cleaner if I could just pass in some functions when I create the asset module and have connect-asset tie things together.

Thanks for your consideration.

Slow when build:true

When setting build:true or running in production. The assets will build, and that is usually slow but expected, but subsequent hits are slow (not as slow but slower than without building)... I can get more details but maybe you were aware of this one.

Usage changed?

I used to have

app.use(require('connect-assets')(src:__dirname+'/assets'))

and when I want to server my assets/fname.coffee, I'd throw this piece of html:

<script src="/fname.js" type="text/javascript"></script>

Now it seems this won't work anymore.

I figured out that __dirname doesn't work anymore from #23,

And now it seems that the only way to trigger compilation is by calling the js and css functions.

Having global js and css functions is cool, but why make it the only way to trigger compilation? Why doesn't a simple request to /fname.js trigger the compilation of assets/fname.coffee anymore?

../subdir

hey i was using the following option src: "../client"

it seems that the view helpers are now truncating the filename (I'm getting src='uery.js' rather than src='jquery.js')

Can't serve multiple js files

In my CoffeeKup template I am using multiple js() lines.

js "/app"
js "/app/controller/Boot"
js "/app/controller/System"

The issue is that only the last one is served. It's System in this case, but if I remove the last line, Boot will be served etc.

How do I serve multiple files with assets?

Support multiple src folders

Our project structure contains a number of local assets specific to the app as well as a number of shared resources that are pulled into the app from a separate, shared project. We'd like to use connect-assets for all of our static resources (both local and shared). To do that, we need to be able to specify multiple 'src' folders that connect-assets would look through when it's resolving a given asset's filename.

Dynamically loading coffeescript files from the frontend

I am using ExtJS 4 and there is a problem with the new loading approach.

Atm I have to call js() from within my html templates but when using ExtJS the files are loaded dynamically from the browser.

That is their are actually making an Ajax request to my coffeescript files eg. "/app/controller/MyController.js" but now it can't find it since I didn't use js() in the HTML template.

  • Isn't there a way to skip js() method at least when I am in development mode since ExtJS is just dynamically loading files in development mode too? In production mode it will have one big JS file compiled. Or else I have to have a list of 100+ files and keep it up to date when I remove usage in my app. It's a real headache and would force me to find another solution than connect-assets :(
  • Would the performance be worse?

production mode is slow - benchmark

In development and test mode, it takes about 16ms to load a "Hello World" template. The same template in production it takes around 850ms to request the same page.

This only happens when connect-assets is loaded. When it is removed from the middleware, the page load time is comparable.

I haven't benchmarked individual code paths, but this is not acceptable for a production environment. I will continue to investigate and benchmark.

Cannot find module './zlib-sync-bindings'

I'm using node 0.6.1 and npm 1.0.106:

$ npm install connect-assets
$ node

require('connect-assets');
Error: Cannot find module './zlib-sync-bindings'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at Object. (/home/dave/Desktop/node_modules/connect-assets/node_modules/connect-file-cache/node_modules/zlib-sync/lib/index.js:1:81)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)

Code breaks with 2.0.2

I had 2.00 rc1 installed but when I upgraded it to 2.0.2 it broke:

The code looks like this:

app.use require("connect-assets")
     src: __dirname + "/../client"

It couldn't find my coffee script files after the upgrade.

Any clue?

'require' parsing is broken

While I can't seem to produce a stand-alone test case, I have found in my application that:

#= require dep1 dep2 dep3

works (generates correct dependency tags and order in generated output), whereas:

#= require dep1
#= require dep2
#= require dep3

does not. I will keep trying to find a small test case that exhibits this problem.

Question / Issue w/ Cluster API

Using the 0.6.6 Cluster API I get odd issues with my bundle assets. It makes sense that this would work be problematic since there is more than one process managing the assets, however is there a way to work around this? I have been looking and haven't had much luck.

minification support

As a developer I should have the ability to provide concatenation and minification os css and javascript assets.

aliases

Great module I just gave it a successful try using express and jqtpl template

One cool feature to add would be the possibility to add alias on javascript files so that we don't have to rename jquery-1.6.js to jquery.js for example

Another one would be to only output javascript dependency once
ie when 2 files requires the same dependency only the first call to js output the <script> tag

New files not recognized by require_tree

Test case:

#= require_tree .

Refresh the page. Add a .js or .coffee file in that script's directory. Refresh the page again. The new file isn't picked up.

The fix will be to watch (or periodically rescan) each directory tree that require_tree is used on.

Gzip

I'd like to store both uncompressed and gzipped versions of every cached file, and serve the gzipped version to browsers with the appropriate headers. The benefits of gzipping are small, but should be noticeable in some cases (e.g. for large assets delivered over cellular connections).

Template helpers don't work with CoffeeKup

When using the css and js helpers in CoffeeKup, they only render if they are the last tag inside another tag.

CoffeeKup functions require them to write to a buffer. The return value of a function isn't always rendered.

I've had a look inside CoffeeKup but it doesn't seem to provide an easy way to attach new tags.

In the mean time the error can be bypassed by creating helpers that wrap the functions in a 'text' tag function (which basically just renders what you pass to it).

ck = require 'coffeekup'

helpers = {
  css: (attrs) ->
    return text global.css(attrs)
  js: (attrs) ->
    return text global.js(attrs)
}

ck.render template, { hardcode: helpers }

I'll keep an eye out to see if anything changes in coffee script that would allow us to easily attach these functions, but if anybody has already figured this out I'll be glad to help implement it.

Generated files should use a standard suffix trailing extensions.

The extension generated by connect-assets are a bit unusual. For instance, if I have the following:

!= js('somescript')

Then I end up (on production) with the following filename:

somescript.complete.js

This should be configurable, because it really should result in:

somescript.min.js

Unable to access "jsCompilers"

I'm new to node.js so this may very well just be my misunderstanding. I'm trying to enable connect-assets to compile my eco templates for use on the front-end. Have the following code (at least it's part of it from my main file for my express app): https://gist.github.com/1431342

When I run that code, I get this error: "Cannot set property 'eco' of undefined".

What am it doing wrong? Or is something broken?

Can only run from root directory

I have my servers setup to run as a service on Ubuntu, so I'm not starting node from the directory it's in.

Before I could setup src as __dirname + 'assets' and it would work fine if I ran node server.js from anywhere, now I'm required to run it from the source directory otherwise connect-assets can't find the assets directory.

Problem wiring the middleware in

Using this for the first time, and I thought this is just great, saving me a lot of time. CoffeeScript all the way.

But I have a bit of a trouble wiring it in. Surely I did something wrong, reading the README ten times did not help. My file structure is this:

/
    assets/
        styles.styl
    app.coffee
    server.js
    public/
        css/
        js/
            jquery.min.js

And my app.coffee is like this (relevant parts):

express = require 'express'

app = module.exports = express.createServer()

oneYear = 31557600000

app.configure ->
    app.set 'views', "#{__dirname}/views"
    app.set 'view engine', 'coffee'
    app.register '.coffee', require('coffeekup').adapters.express
    #app.use require('stylus').middleware src: "#{__dirname}/public", dest: "#{__dirname}/public", compress: true
    app.use require('connect-assets') src: "#{__dirname}/assets/"
    app.use express.cookieParser()
    app.use express.methodOverride()
    app.use express.bodyParser()
    app.use app.router

app.configure 'development', ->
    app.use express.static "#{__dirname}/public"
    app.use express.logger format: ':method :url'
    app.use express.errorHandler dumpExceptions: true, showStack: true

app.configure 'production', ->
    app.use express.static "#{__dirname}/public", maxAge: oneYear 
    app.use express.errorHandler()

app.get '/', (req, res) ->
    res.render 'index', title: 'Express'

I am using CoffeeKup for the views, because I like CoffeeScript that much. My view:

doctype 5
html ->
    head ->
        meta charset: 'utf-8'
        title "#{@title or 'Untitled'}"
        meta(name: 'description', content: @description) if @description?
        css 'styles'
        js 'jquery.min'
    body @body or 'No content'

All right, so when I now open the route '/', I get this error:

TemplateError: Error rendering /home/scan/Javascript/neighr/views/layout.coffee: No file found for route css/styles.css

It can't find js/jquery.min.js either when I comment out the css line.

CoffeeKup is similar to jade when it comes to external functions, according to their docs. So what did I do wrong?

express using connect-assets example

Hello Trevor, I previously opened an issue (#31) describing breaking changes that occurred after 2.0.0-rc1. I am still having trouble getting connect-assets to work as you describe in your documentation. Essentially 2.0.0-rc1 works as expected but I can't get any version higher to work for me. I understand that I am probably implementing your new modifications incorrectly (or the documentation is ambiguous), so I have created a very simple github project to example my issue. If you could take a quick minute to have a look it would be very much appreciated. The project is located here https://github.com/veerman/connect-assets-test . I have changed the assets src directory to point to 'public' in the project folder. Basically requests to http://localhost:5678/a.coffee work if you modify the project to use 2.0.0-rc1, but fail for any subsequent version. What am I doing wrong?

Thanks in advance,
Steve

node 0.6.2 support

node -v
v0.6.2

npm install connect-assets
Error: npm doesn't work with node v0.6.2
Required: [email protected] || 0.5
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:57:23
at Object. (/usr/local/lib/node_modules/npm/bin/npm-cli.js:77:2)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)

"bare" compilation

Is there any support for --bare compilation (ie no lambda wrapping).

This is necessary for webworkers. The issue is discussed here wrt server-side workers pgriess/node-webworker#14. In my case, it's actually client-side workers. I'm trying to set up a JSONP call with importScripts in the client, and there's no namespace to hang the callback on.

importScripts "api.twitter.com?callback=go"
go = -> doSomething()

This doesn't work because of the lambda wrapping. The equivalent in JavaScript does work.

Any plan to support LESSCSS ?

Hi,
I just want to know if there is any plan to support Lesscss in addition to Stylus as a CSS preprocessor in a near future ?

Paths in Windows

Hi,
I have a problem with the resolution of relative paths to the absolute path under windows (win 7 64bit).
Node is searching for the files under 'D:\git\wedex\academy\lib\D:\git\wedex\academy\lib\public\css\bootstrap.min.css',
but it should be 'D:\git\wedex\academy\lib\public\css\bootstrap.min.css'.
You can see that there is a duplication in the path.

Thanks

js() doesn't work on iPhone/iPad

So js() works on desktops/laptops but not on iPhones and iPads.

I have no idea why but when I switched back to 2.0.0-rc1 it worked perfect.

A lot of issues with the new loading system :)

Can't there be a mode for the regular "script" loading?

Allow adding new compilers

We're using connect-assets with a sproutcore application on the frontend.
Therefore, we have handlebars files, which needs to have a specific precompilation.

Currently, we need to fork the project into our own directory and add the new compiler directly with the other ones.
It'd be very cool if we could add our own compilers without having to fork the project.

Caching

I'd like to emulate the Rails 3.1 approach to caching (in production mode): Far-future headers are set on each script that's served, and the MD5 hash of the script's contents is appended to the file's name.

Extension API

I would like to add haml-coffee compiler which compiles assets/js/templates/articles/show.hamlc to something like window.templates.articles.show = function(params) { return ... } in assets/js/templates/articles/show.js. For now I use terminal watching script for this purpose, but native connect-assets compiler would be much more awesome. Is there any way to do that?

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.