question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Whats the difference b/w "loader" and "loaders" inside "loaders" object?

See original GitHub issue

When I am using React-Hot-loader, I see syntax like “loaders” that takes an array of loaders like react-hot and babel. But for css, the loader is spelled “loader” and the value is a string where we pipe results of css-loader to style-loader. What’s the difference? @sokra @gaearon

module: {
    loaders: [{
        test: /\.jsx?$/,
        loaders: ['react-hot', 'babel'],
      },
      {
      test: /\.css$/,
      loader: 'style!css'
    }
    ]
  }

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sokracommented, Apr 29, 2016

Since webpack 2 there is no difference.

In webpack 1, loaders takes an array, loader takes a string.

0reactions
rajaraodvcommented, Apr 29, 2016

Great! Thanks for the explanation!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Loaders - webpack
Loaders are transformations that are applied to the source code of a module. They allow you to pre-process files as you import or...
Read more >
Difference between Linker and Loader - GeeksforGeeks
Loaders are of 4 types: Absolute, Relocating, Direct Linking, Bootstrap. Another use of linker is to combine all object modules. It helps in ......
Read more >
Rules vs Loaders in Webpack - What's the Difference?
Loaders are used in Webpack 1. Rules are used in Webpack 2 +. According to the migrating docs at the official Webpack site....
Read more >
Loaders | Android Developers
Loader, Loaders perform the loading of data. This class is abstract and serves as the base class for all loaders. You can directly...
Read more >
Webpack Loaders, CSS and Style Loaders | by Bharat Tiwari
css-loader is the npm module that would help webpack to collect CSS from all the css files referenced in your application and put...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found