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.

webpack5 and loaders defined as `.mjs`: enable use of `someloader.mjs` ?

See original GitHub issue

Feature request

What is the expected behavior?

  • creating a loader as someloader.cjs or someloader.js works perflectly
  • creating the same loader as someloader.mjs throws error (see below

image

What is motivation or use case for adding/changing the behavior?

  • i (and others imo) want to define loaders as mjs

How should this be implemented in your opinion?

  • i would need to review webpack internals (and docs, as i could be wrong and theres a bug in my code) before providing an opinion

Are you willing to work on this yourself? yes (with proper support on webpack internals)

example repository where i tried to load someloader.mjs

  • clone repo
  • $ cd packages/libraries/configproto/webpack
  • $ pnpm install
  • $ node removeFlowTypesLoader.test.mjs
  • see error in terminal

more information

Issue Analytics

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

github_iconTop GitHub Comments

2reactions
alexander-akaitcommented, Aug 24, 2021

Please update webpack to the latest version too

2reactions
alexander-akaitcommented, Aug 24, 2021

Something wrong with tap

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack 5 release (2020-10-10)
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 >
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 >
Module | webpack - JS.ORG
Applied loaders: An array of loaders applied to the resource. Parser options: An options object which should be used to create the parser...
Read more >
Module Methods - 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 >
ECMAScript Modules - 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 >

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