Giter Site home page Giter Site logo

ES6/Babel support about cjsx-loader HOT 5 CLOSED

kyleamathews avatar kyleamathews commented on May 24, 2024
ES6/Babel support

from cjsx-loader.

Comments (5)

KyleAMathews avatar KyleAMathews commented on May 24, 2024

Hi you want https://github.com/babel/babel-loader for this.

from cjsx-loader.

TrySpace avatar TrySpace commented on May 24, 2024

What I mean is if there is any plans to add babel-loader to this repo.

I'm struggling to add it myself, because simply adding "babel?presets[]=es2015" to the 'cjsx' loaders gives me the error that import is a reserved word, or it doesn't recognize #

from cjsx-loader.

KyleAMathews avatar KyleAMathews commented on May 24, 2024

You don't understand Webpack loaders correctly. Each Webpack loader (like this one) is meant to be used only with one type of file. cjsx-loader is designed to load/transform CJSX (JSX in Coffeescript) and that's it. Combining Babel and CJSX would be weird... try imagining a file with Coffeescript and Javascript intermingled.

Try googling for some tutorials on setting up Webpack loaders. They can be pretty confusing at first for sure.

from cjsx-loader.

TrySpace avatar TrySpace commented on May 24, 2024

Ok, so I found out the maintainer is coffeescript is very unwilling to adapt any es6 syntax.
On the other hand, I found out there is similar Class definitions and a lot of other similarities, so I don't have to completely rewrite es6 code examples that much.
Mainly the import is the most annoying, but there is https://www.npmjs.com/package/coffee-import, however, I can't get that to work with cjsx yet, not sure if it's the load order, or it would have to be combined probably.

from cjsx-loader.

TrySpace avatar TrySpace commented on May 24, 2024

Also, there was even a kickstarter for a potential coffeescript 2, called coffee-redux, but it has been inactive for almost a year now, and it seems that it's also dead: michaelficarra/CoffeeScriptRedux#338

It's likely because of this coffeescript is dying, and hopefully will be replaced by a new language.

Perhaps Earl Grey
Or something like PureScript
Maybe BabelScript, I like the name, but it's a shell of an RFC proposal, so basically nothing at all...
Or TacoScript
But offcourse for the real pros there's always: DogeScript which is taking the world by storm.

Although they would all require rewriting existing code.

from cjsx-loader.

Related Issues (11)

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.