Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

181
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda