Vaadin 14 - Questions about package.json and pnpm-lock.yaml


I have notices some files like “package.json” “pnpm-lock.yaml” “webpack.config.js” etc
Is these files generated automatically or created manually?

Should I put these files in gitignore, is there a gitignore best practice I can follow?

Thanks & Regards


At the end of this page you have a good summary of the best practices:

The following files/folders have been generated in the root of your project:

  • package.json and package-lock.json pnpm-lock.yaml: These files keep track of npm packages and pin their versions. You may want to add these to version control, in particular, if you added any local package directly with npm.
  • node_modules directory: npm package cache, do not add this to version control!
  • webpack.config.js: webpack configuration. Include in version control. You can add custom webpack configuration to this file.
  • webpack.generated.js: Auto-generated webpack configuration imported by webpack.config.js. Do not add to version control, as it is always overwritten by vaadin-maven-plugin during execution of the prepare-frontend goal.

By default you can use the gitignore included in our starter: (from Vaadin 16 starter)



# MacOS

# Eclipse

# The following files are generated/updated by vaadin-maven-plugin

# Browser drivers for local integration tests
# Error screenshots generated by TestBench for failed integration tests