question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generate manifest.json during build process

See original GitHub issue

What problem does this feature solve?

I’ve been working lately on non-SPA, non-Vue app. In order not to write the whole Webpack config on my own I took a great symfony/webpack-encore config. I think there’s one thing that Vue CLI could learn from symfony/webpack-encore - it’s manifest.json

In webpack-encore the build process generates a manifest.json file that lists all the assets generated during build. Then, the backend code can read the content of the file and enqueue all the assets. It’s especially helpful when assets names are hashed.

Example content of the manifest.json file after running yarn serve

{
  "app.css": "http://localhost:8080/app.css",
  "app.js": "http://localhost:8080/app.js",
}

Example content of the manifest.json file after running yarn build

{
  "app.css": "dist/app.9743a66f914cc249efca164485a19c5c.css",
  "app.js": "dist/app.098f6bcd4621d373cade4e832627b4f6.js",
}

What does the proposed API look like?

I’m not sure if manifest.json should be generated by default, but for sure there should be a setting allowing enabling/disabling manifset.json generation.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:5
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

15reactions
tarikhamiltoncommented, Mar 29, 2019

I added my own asset-manifest.json file on my own using the proposed lib.

I can see why this might not be added to vue-cli, as it was pretty easy to implement independently.

const WebpackAssetsManifest = require('webpack-assets-manifest')

module.exports = {
  // ...your other modifications,
  configureWebpack: config => {
    config.plugins = config.plugins.concat(
      new WebpackAssetsManifest({
        output: 'asset-manifest.json'
      })
    )
  }
}
12reactions
benzkjicommented, Feb 19, 2019

status of manifest.json is not clear for me, when using @vue/cli-plugin-pwa. A manifest.json is added in the public folder when the plugin is initialized. This file is copied to dist. But never updated. IMO a manifest.json should not be added to the public folder, but generated for each build, respecting configurations from the vue.config.js ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building a Manifest File with npm - LearnHowToProgram.com
Our first step in creating our project's development environment is to set up npm and create a package.json file. We will need to...
Read more >
Generating the manifest.json File Using the bwdesign Utility
Procedure · Open a command prompt or terminal window. · Navigate to <BW_HOME> \bin directory. · Enter the following command: bwdesign · Enter...
Read more >
Create the manifest.json File - Oracle Help Center
Create the manifest.json File. The manifest.json file specifies how to launch your application. Optionally, you can include the runtime version and other ...
Read more >
Create a mix-manifest.json file with esbuild | stefanzweifel.io
When creating a new build with Jigsaw, the generated HTML will load the CSS file with the hashed value. This makes cache busting...
Read more >
Change properties in manifest.json file on build - Stack Overflow
So the manifest file is generated by vue-cli every time you build your app. So you shouldn't be using it to seed the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found