Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
Is there a way we can modify manifest.json generated in dev-server mode

I am using webpack-manifest-plugin plugin to generate a manifest.json file. After that i have another plugin that runs after the complete build is done. There I want to modify the manifest.json.Now this works fine with prod build(we are doing writeFileSync to update).

But in the dev-server build manifest.json does not get updated(as it not present in the filesystem it is in memory). I want to update manifest.json after the complete build is done in dev-server-mode. In dev-server mode build will not use the local file system it will in memory.

compiler.hooks.done.tap('After Compilation', (stats) => {
     // some code to update the manifest.json
})

Please let me know any way to access manifest.json post build and update in dev-server. I tried afterEmit of webpack-manifest-plugin but I want it after the entire build is done.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Hi, as variant you can use plugin "copy-webpack-plugin" for webpack.

npm: https://www.npmjs.com/package/copy-webpack-plugin#filter

You can get manifest "content" and do whatever you want.

For instance: create file in development mode inside build folder.

const fs = require('fs')
const CopyPlugin = require('copy-webpack-plugin');

new CopyPlugin({
  patterns: [
    {
      from: 'public/manifest.json',
      transform(content) {
        // create manifest.json for development
        if (process.env.NODE_ENV === 'development') {
          fs.writeFile('./build/manifest.json', content, function (err) {
            if (err) throw err;
            console.log('Saved!');
          })
        }

        return content
      },
    },
  ],
})
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!