Code Monkey home page Code Monkey logo

Comments (2)

thekip avatar thekip commented on June 9, 2024

Thanks for the patch. Do they have documentation about compatibility of turborepo with webpack loaders?

As far as I understand from your patch when loader is executed by turborepo, there is no this._module variable, and it probably crashes when it accesses this._module.type. Am I right?

Just for context:

condition:

namespace: this._module.type === "json" ? "json" : "es",

Made to overcome the issue with webpack. Webpack doesn't allow (at least with public methods) switching type of the module in the loader. It means if you're loading "*.json" module through loader webpack expects json output from this loader. When you load any unknown to webpack module such as *.po or *.png file, webpack expects a valid ES module as output.

So this poses a problem, lingui user may load and compile catalog using *.json extension (lingui or minimal catalog formats) and using *.po format. Loader should work for both of the cases. That's the purpose of this condition.

from js-lingui.

Palid avatar Palid commented on June 9, 2024

@thekip It does not break compat with webpack by chacking if we have this._module though. If we do - just go through with webpack part, if we don't we're probably in different bundler (e.g. turbopack).

It's just a quick&dirty hack to make sure this works, as turbopack makes compilation so much quicker.

from js-lingui.

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.