Giter VIP home page Giter VIP logo

connect-compiler's People

Contributors

andrewradev avatar dsc 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

Watchers

 avatar  avatar

connect-compiler's Issues

Serves stale compiled file if there is a compilation error

Since old compiled files are not deleted when recompiling the static middleware will serve the old file if compilation of the new file fails, which leads to confusion when developing while not paying close attention to the log.

One fix would be to delete the stale compiled file before trying to compile the new file.

replace sass.js implementation with support for node-sass

the support for sass.js doesn't seem to work anymore:

with the following server.coffee:

connect = require 'connect'
compiler = require 'connect-compiler'
# uncomment as required
# sass = require 'node-sass'
# sass = require 'sass.js'

server = connect.createServer(
    connect.logger 'dev'
    connect.favicon()
    compiler
        enabled: ['sass', 'coffee', 'jade']
        src: 'src'
        dest: 'tmp'
        resolve_index: true

    connect.static __dirname + '/src'
    connect.static __dirname + '/tmp'
)
server.listen 8000
  • with sass.js installed:
    • sass not found
  • with node-sass installed:
    • sass not found

this.die() not found

I've added the compiler middleware to my Express app for development mode, with enabled = ['coffee']. However, the middleware crashes on every request, because when it tries to parse any request, it gets to a line that calls this.die() and fails because the "this" object doesn't have such method.

(The reason why it gets to this line isn't actually an error, it's trying to match a request that isn't even loading a static asset (it's handled by a controller action) and since the URL doesn't end with ".js", it gives up.)

Error message:

TypeError: Object # has no method 'die'
at Object. (.../node_modules/connect-compiler/compiler.js:487:12)

Problem exporting to a subfolder of the static folder

Hi!
For some unknown reason I cannot make the compiler work when the dest folder is a subfolder of my static folder.

    app.use compiler
        enabled: ['coffee']
        src: "#{__dirname}/assets/coffee"
        dest: "#{__dirname}/public/js"

    app.use express.static "#{root}/public"

Is it a bug or am I doing something wrong? Thanks for your help!

Add support for streaming instead of serving from disk

You'll have to excuse me if I mis understood how connect-compiler should work, but perhaps an option should be made available that skips writing/serving anything from disk and instead streams it directly.

If we all understand that assets should be compiled, minified, hashed, gzipped and bamboozled in production, then I hope we can understand that streaming compiled assets directly during development would eliminate any problems of stale files.

Stale src files aren't recompiled

Latest version of express, latest version of connect-compiler, and this code:

var express = require('express');
var compiler = require('connect-compiler');

var app = express.createServer();
pub = __dirname + '/public';
app.use (express.static (pub));
app.use (compiler ({src: pub, enabled: ['less']}));

app.listen(4100);

Write something in public/style.less, GET it, and then change it a few times: it doesn't update.

Any ideas?

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.