Giter Site home page Giter Site logo

cjsx-loader's Introduction

coffee-react-transform loader module for Webpack.

Install

npm install cjsx-loader

Usage

Here's a simple webpack.config.js file that you could use. For a more sophisticated/complete example, see my coffee-react-quickstart project.

var path = require('path');
var webpack = require('webpack');

module.exports = {
  entry: [
    "webpack-dev-server/client?http://0.0.0.0:8080",
    './src/scripts/router'
  ],
  devtool: "eval",
  output: {
    path: path.join(__dirname, "public"),
    filename: 'bundle.js'
  },
  resolveLoader: {
    modulesDirectories: ['node_modules']
  },
  resolve: {
    extensions: ['', '.js', '.cjsx', '.coffee']
  },
  module: {
    loaders: [
      { test: /\.cjsx$/, loaders: ['coffee', 'cjsx']},
      { test: /\.coffee$/, loader: 'coffee' }
    ]
  }
};

cjsx-loader's People

Contributors

agilgur5 avatar dawidjanczak avatar kyleamathews avatar levibuzolic avatar mindreframer avatar thibautsacreste 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

Watchers

 avatar  avatar  avatar

cjsx-loader's Issues

Ternary ops

So I've tried to use cjsx-loader in an existing project. First thing is that I had to remove `s of all components. Then it complained about ternary operators. Do you have any clue how to keep 'em instead of moving them to a method (which in many cases decreases readability)?

cjsx-loader does not parse when being used as loader in Karma and webpack setup

In a karma and webpack setup, karma shows the following warning:

WARNING in ./test/component_spec.cjsx
Module parse failed: /home/ivan/BestMile/testing/coffee-react-karma-webpack-phantomjs/node_modules/cjsx-loader/index.js!/home/ivan/BestMile/testing/coffee-react-karma-webpack-phantomjs/test/component_spec.cjsx Line 1: Unexpected string
You may need an appropriate loader to handle this file type.
| rewire = require 'rewire'
| mockComponent = require './support/mock_component'
| React = require 'react/addons'
 @ ./test _spec$

WARNING in ./test/link_spec.cjsx
Module parse failed: /home/ivan/BestMile/testing/coffee-react-karma-webpack-phantomjs/node_modules/cjsx-loader/index.js!/home/ivan/BestMile/testing/coffee-react-karma-webpack-phantomjs/test/link_spec.cjsx Line 1: Unexpected string
You may need an appropriate loader to handle this file type.
| React = require 'react/addons'
| TestUtils = React.addons.TestUtils
| Link = require '../src/link'
 @ ./test _spec$

WARNING in ./test/nested/button_spec.cjsx
Module parse failed: /home/ivan/BestMile/testing/coffee-react-karma-webpack-phantomjs/node_modules/cjsx-loader/index.js!/home/ivan/BestMile/testing/coffee-react-karma-webpack-phantomjs/test/nested/button_spec.cjsx Line 1: Unexpected string
You may need an appropriate loader to handle this file type.
| React = require 'react/addons'
| TestUtils = React.addons.TestUtils
| Button = require '../../src/nested/button'
 @ ./test _spec$
08 12 2015 16:29:27.342:WARN [karma]: No captured browser, open http://localhost:9876/
08 12 2015 16:29:27.348:INFO [karma]: Karma v0.13.15 server started at http://localhost:9876/
08 12 2015 16:29:27.352:INFO [launcher]: Starting browser PhantomJS
08 12 2015 16:29:27.571:INFO [PhantomJS 1.9.8 (Linux 0.0.0)]: Connected on socket WdOa2N8udaAdoJWqAAAA with id 21165775
PhantomJS 1.9.8 (Linux 0.0.0): Executed 0 of 0 ERROR (0.039 secs / 0 secs)

This does happen when using the coffee-jsx-loader, so I do not think it is a Karma problem.

cjsx-loader uses a vulnerable version of loader-utils

There is a prototype pollution vulnerability in function parseQuery in parseQuery.js in webpack loader-utils prior to version 2.0.3 via the name variable in parseQuery.js.

Do you plan on updating the loader-utils dependency in your package?

ES6/Babel support

Any plans on supporting es6/babel syntax, or conversion from ES6 to ES5?

coffee-react-transform 2.4.1 is broken

2.4.0 is OK, and 3.0.0 is problably OK (worth testing) but this uses ^2.2.1 which resolves to 2.4.1 which is deprecated because of some edge cases. It's breaking our build due to the spread operator not working correctly.

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.