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.

Does this loader support Webpack 2? If so, how would you specify the options with the new rules API?

For example. I have this:

{
    test: /globalize/,
    loader: 'imports?define=>false',
},

I was thinking:

{
    test: /globalize/,
    use: [{ loader: 'imports-loader', options: { 'define=>false': '' } }],
}

But I’m unsure, and it seems odd…

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
ahmedelgabricommented, Jan 26, 2017

I’m using this and it still working for me:

{ 
  test: require.resolve('foo'), 
  use: ['imports-loader?this=>window', 'exports-loader?foo'] 
}
3reactions
Vanuancommented, Mar 12, 2017

I’ve resolved my issue using a built-in option:

module: {
  rules: [
    { parser: { amd: false } }
  ]
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >
A beginner's guide to Webpack 2 - Medium
A beginner's guide to Webpack 2 · Introduction · Setup and Installation · Installing Webpack · Webpack configuration file · using html-webpack-plugin to...
Read more >
webpack2 - npm
Packs CommonJs/AMD modules for the browser. Allows to split your codebase into multiple bundles, which can be loaded on demand.
Read more >
Webpack 2 Documentation - W3cubDocs
webpack is a tool to build JavaScript modules in your application. To start using webpack from its cli or api, follow the Installation...
Read more >
THE WEBPACK CORE CONCEPTS | Webpack 2 Basics Tutorial
All about entry, output, module & loaders as well as plugins! Learn Webpack 2 - what it is, how it works and how...
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