GithubHelp home page GithubHelp logo

Comments (6)

sokra avatar sokra commented on April 27, 2024

are plugins supported using enhanced require?

no, and it's a webpack plugin...

from enhanced-require.

sokra avatar sokra commented on April 27, 2024

I think options.resolve is also not supported...

It's only node.js style resolve...

from enhanced-require.

richardscarrott avatar richardscarrott commented on April 27, 2024

I think I'm perhaps misusing enhanced-require; I'm attempting to write an isomorphic web app where the initial html is rendered on the server for seo and faster load times.

I originally tried running the bundled src from the client side app using node's require however because the bundle doesn't export anything I had no way of retrieving the generated html string other than storing it on a global.

I then came across this project which I imagined I could use in a similar manner to requirejs in node whereby you'd require in the (non-bundled) src code however it seems enhanced-require doesn't have feature parity with webpack so I can't run the same code as on the client?

Is enhanced-require designed for this use-case or is it designed to be independent from webpack and just offers a, well, enhanced require for node?

from enhanced-require.

akiran avatar akiran commented on April 27, 2024

@richardscarrott, did you find a solution to this problem

I also ran into this issue
http://stackoverflow.com/questions/28275775/how-to-handle-window-object-on-nodejs-for-server-side-rendering-of-reactjs-appli

I am also trying to implement isomorphic react application and use webpack for client side build.
I am trying to use enhanced-require to handle jsx files on nodejs.

But, imports of libraries that use window object are failing. To overcome this problem I tried to use IgnorePlugin. It looks like webpack plugins doesn't work with enhanced-require

@sokra Do you have any suggestions for this usecase.

from enhanced-require.

sokra avatar sokra commented on April 27, 2024

@sokra Do you have any suggestions for this usecase.

Compile with webpack --target node and run the compiled version...

from enhanced-require.

richardscarrott avatar richardscarrott commented on April 27, 2024

I see you have a good example of this here - https://github.com/webpack/react-webpack-server-side-example, thanks!

from enhanced-require.

Related Issues (14)

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.