Giter VIP home page Giter VIP logo

Comments (5)

medikoo avatar medikoo commented on June 6, 2024

I'm not sure what exactly you suggesting. You'd like to run require with two arguments and make webmake to treat a second one as one for browser?
For second part, I plan to allow customization of searched paths with that reworked version of webmake that we were talking about, so something similar would be possible.

from modules-webmake.

Phoscur avatar Phoscur commented on June 6, 2024

Sorry, I'm actually suggesting two different proposals for the same idea.
For example (even though this might be more complicated in reality) when you require("jquery"), on the serverside, it's a module with jsdom implementation to support a dom on serverside, when you require("jquery") on the browserside, it's just jquery warpped into the commonjs module pattern.
Now as webmake compiles the code, it should pick up the browserside module instead of the serverside one.

This could be accomplished either by an argument to pass a map ("Given two module names...") to webmake, or webmake picking up replacement modules from a specific folder ("browser_modules").

from modules-webmake.

medikoo avatar medikoo commented on June 6, 2024

I think that in that case you should find or prepare raw jquery package that's not configured strictly for server or client-side and use that. It's an issue of 'jquery' package that it's configured that way and not webmake, also check maybe you can easily import jquery module from there without importing any jsdom module.

from modules-webmake.

medikoo avatar medikoo commented on June 6, 2024

I think adding such feature would just add not needed complexity. Modules that can be used on server and client should be imported same way for either side.

from modules-webmake.

Phoscur avatar Phoscur commented on June 6, 2024

Just thinking, it could be useful in cases like replacing the serverside database connection with one that works in the browser.
Well, you are probably right, and what I want can also be achieved differently (e.g. Dependency Injection).

from modules-webmake.

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.