Code Monkey home page Code Monkey logo

Comments (4)

amireh avatar amireh commented on May 18, 2024 2

You need to use an array if you're using loaders (note the plural form):

{
    test: /\.js$/,
    loaders: [ 'happypack/loader?id=js' ],
    exclude: /node_modules/
},

from happypack.

amireh avatar amireh commented on May 18, 2024 1

So, webpack 1.x accepts loaders in two forms and two variants:

// form 1: a single loader with an "object" query:
{
  loader: 'my-single-loader',
  query: { "foo": "bar" } // this is optional
}

// form 1, variant 2: a single loader with inline query:
{
  loader: 'my-single-loader?foo=bar',
  query: {} // this is optional
}

// form 2: multiple loaders, inline queries:
{
  loaders: [ 'a', 'b?foo=bar' ]
}

HappyPack only accepts loaders as an Array. But it lets you either use strings with inline queries (like form 1 variant 2 above) or an object with path: String and query: String, somewhat similar to Webpack 2, but Webpack 2 allows you to use objects for query which we can easily support if needed.

I should probably do that last bit to relieve some of this confusion.

from happypack.

vinnymac avatar vinnymac commented on May 18, 2024

Interesting, I had the same problem and found the solution here. In your README.md you specify a single jsx loader, but you use the word loaders. I copied this example in order to test, perhaps that is what happened to the OP.

from happypack.

amireh avatar amireh commented on May 18, 2024

The README was amended to now only use loaders (plural) everywhere. Is there anything else for this ticket?

from happypack.

Related Issues (20)

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.