diff --git a/src/pages/framework/customization/_meta.json b/src/pages/framework/customization/_meta.json index cb1b07b..c4be6a0 100644 --- a/src/pages/framework/customization/_meta.json +++ b/src/pages/framework/customization/_meta.json @@ -4,5 +4,6 @@ "src": "Use src Directory", "html": "Replace the HTML", "alias": "Alias Imports", - "internal-path": "Internal Paths" + "internal-path": "Internal Paths", + "custom-parcelrc": "Custom .parcelrc" } diff --git a/src/pages/framework/customization/custom-parcelrc.mdx b/src/pages/framework/customization/custom-parcelrc.mdx new file mode 100644 index 0000000..7fc4c1c --- /dev/null +++ b/src/pages/framework/customization/custom-parcelrc.mdx @@ -0,0 +1,38 @@ +--- +description: Using custom .parcelrc +--- + +import { Callout } from "nextra-theme-docs" + +# Customizing Parcel with custom `.parcelrc` + +Plasmo allows you to customize the Parcel bundler configuration by using a custom `.parcelrc` file. This file lets you override or extend the default settings, enabling you to tailor the build process to your project's specific needs. + +## Overview + +The `.parcelrc` file is a JSON configuration file placed in the root of your project. It defines how Parcel processes your assets by specifying transformers, bundlers, namers, and runtimes. + +If you don't create a `.parcelrc` file, Plasmo will use its default configuration. However, advanced use cases can leverage a custom file to introduce custom behavior or integrate additional plugins. + + + +Important: For your Plasmo project to build correctly, the custom configuration file must extend `@plasmohq/parcel-config`. This ensures that all necessary default settings and optimizations are inherited for seamless integration with Plasmo's build system. + + + +## Example + +### Using custom parcel namer + +```json +{ + "extends": "@plasmohq/parcel-config", + "namers": ["parcel-namer-hashless"] +} +``` + +This config setup and applies a custom namer plugin to generate hashless file names. + +## Conclusion + +The `.parcelrc` file is a powerful tool for customizing the Parcel bundler within your Plasmo projects. By tweaking the configuration, you can optimize the build process, integrate custom plugins, and tailor the toolchain to your project’s needs.