Gatsby Plugin Asset Path screenshot

Gatsby Plugin Asset Path

Author Avatar Theme by Madecomfy
Updated: 3 Jun 2021
14 Stars

Move all of your JS and CSS build files, as well as the static folder into a subdirectory of your choice

Categories

Overview

Gatsby has long been a favored choice for developers seeking to create fast, modern websites. The introduction of the gatsby-plugin-asset-path is a game-changer, especially for those who deploy with AWS Cloudfront/S3. This plugin allows developers to manage their JavaScript and CSS files more effectively by organizing them into a specified subdirectory, which enhances site stability and caching during deployments.

As websites grow and evolve, maintaining distinct builds is crucial. The challenges faced with file name collisions during deployments are now manageable, thanks to the capabilities of this plugin. By ensuring that each build’s assets are preserved separately, your visitors will enjoy a smooth browsing experience, free from interruptions and inconsistencies.

Features

  • Subdirectory Management: Copy all your JS and CSS build files, along with static folders, into a customizable subdirectory for organized asset management.

  • Breaking Changes Handling: Transition from earlier versions with ease by using the new paths option for defining asset locations, adapting to changes from previous versions of the plugin.

  • Asset Prefix Configuration: Adjust the assetPrefix for improved control over file paths, ensuring that your static assets do not conflict with one another during deployment.

  • Custom File Types: Specify which file types (JS and CSS by default) to copy, making it easy to tailor the plugin to your specific needs and file management practices.

  • Default Options: Utilize sensible defaults for paths and file types, streamlining the setup process for new users without requiring extensive configuration.

  • Disable Source Maps: Option to prevent Webpack from generating .js.map files, which can help reduce the clutter and complexity of your asset directory.

  • Version Control: Keep your assets synchronized by updating versioning in your package.json, facilitating smooth releases and updates through GitHub.