Giter Club home page Giter Club logo

Comments (3)

catamphetamine avatar catamphetamine commented on June 10, 2024

The example project uses clean-webpack-plugin and it works.
https://github.com/catamphetamine/webpack-react-redux-server-side-render-example
That project builds server in build/server and client in build/assets and webpack-chunks.json is generated in build so it's not cleared: only build/assets is cleared.

from universal-webpack.

catamphetamine avatar catamphetamine commented on June 10, 2024

Actually, my answer wasn't 100% correct: webpack-chunks.json is not output in build, it's output in build/assets and build/assets is cleaned:

image

I guess your issue is that you run clean plugin after universal-webpack plugin.

from universal-webpack.

catamphetamine avatar catamphetamine commented on June 10, 2024

The code adds universal-webpack plugin after clean plugin so normally universal-webpack plugin can't run before clean.

configuration.plugins = configuration.plugins || []
configuration.plugins.push
(
// Add chunk filename info plugin
//
// Writes client-side build chunks filename info
// for later use inside server-side rendering code
// (`<script src=.../>` and `<link rel="style" href=.../>` tags)
//
// Cloning Webpack configuration here
// because `webpack-dev-server` seems to alter it
// by changing the already predefined `.output.path`.
//
new chunks_plugin(clone(configuration), { silent: settings.silent, chunk_info_filename: settings.chunk_info_filename })
)

Examine your resulting webpack config and see the order.

from universal-webpack.

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.