{"record":{"id":"da18bb55afa98ee6","repo":"parcel-bundler/parcel","slug":"local-plugins-are-not-supported-in-parcel-config-p","errorCode":null,"errorMessage":"Local plugins are not supported in Parcel config packages. Please publish \"${pluginName}\" as a separate npm package.","messagePattern":"Local plugins are not supported in Parcel config packages\\. Please publish \"(.+?)\" as a separate npm package\\.","errorType":"exception","errorClass":"ThrowableDiagnostic","httpStatus":null,"severity":"error","filePath":"packages/core/core/src/loadParcelPlugin.js","lineNumber":47,"sourceCode":"): Promise<{|\n  plugin: T,\n  version: Semver,\n  resolveFrom: ProjectPath,\n  range: ?SemverRange,\n|} | null> {\n  let resolveFrom = configPath;\n  let range;\n  let isOptional = false;\n  if (\n    resolveFrom.includes(NODE_MODULES) ||\n    (process.env.PARCEL_BUILD_ENV !== 'production' &&\n      /packages[/\\\\]configs/.test(resolveFrom))\n  ) {\n    // Config packages can reference plugins, but cannot contain other plugins within them.\n    // This forces every published plugin to be published separately so they can be mixed and matched if needed.\n    if (pluginName.startsWith('.')) {\n      let configContents = await options.inputFS.readFile(configPath, 'utf8');\n      throw new ThrowableDiagnostic({\n        diagnostic: {\n          message: md`Local plugins are not supported in Parcel config packages. Please publish \"${pluginName}\" as a separate npm package.`,\n          origin: '@parcel/core',\n          codeFrames: keyPath\n            ? [\n                {\n                  filePath: configPath,\n                  language: 'json5',\n                  code: configContents,\n                  codeHighlights: generateJSONCodeHighlights(configContents, [\n                    {\n                      key: keyPath,\n                      type: 'value',\n                    },\n                  ]),\n                },\n              ]\n            : undefined,","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/parcel-bundler/parcel/blob/59484858a1a0bcbb71f74088956bb437a2db6505/packages/core/core/src/loadParcelPlugin.js#L29-L65","documentation":"A Parcel *config package* (a published `.parcelrc`-bearing npm package) may reference plugins, but every plugin it references must itself be a separately-published npm package. This is enforced so plugins remain individually mixable across configs. Referencing a plugin by a relative path (starting with `.`) inside the config package is rejected with this diagnostic, including a code frame of the offending `.parcelrc`.","triggerScenarios":"Inside a config package, a pipeline entry resolves to a relative file (e.g. `./my-plugin.js`) rather than an npm package name.","commonSituations":"Authoring a shared Parcel config and bundling helper plugins as local files inside it.","solutions":["Publish the local plugin as its own npm package and reference it by name.","If the plugin is project-specific, keep it in the consuming project's `.parcelrc` (local configs may use relative paths), not in a published config package.","Move the relative plugin out of the config package into the app that uses it."],"exampleFix":"// before (config package .parcelrc)\n{ \"transforms\": { \"*.css\": [\"./local-transformer.js\"] } }\n\n// after\n{ \"transforms\": { \"*.css\": [\"@your-scope/parcel-transformer-css\"] } }","handlingStrategy":"validation","validationCode":"// In a config package, reject relative plugin references at author time.\nfunction isRelativePlugin(ref: string): boolean {\n  return ref.startsWith('.');\n}\nif (isRelativePlugin(entry)) throw new Error('publish the plugin as a package');","typeGuard":"function isPublishedPluginName(ref: string): boolean {\n  return !ref.startsWith('.');\n}","tryCatchPattern":null,"preventionTips":["Never ship plugins inside a config package; publish each separately.","Keep relative plugins in the consuming project's local .parcelrc."],"tags":["config","plugin","packaging","parcelrc"],"backgroundTag":null,"analyzedSha":"59484858a1a0bcbb71f74088956bb437a2db6505","analyzedAt":"2026-08-13T04:06:35.925Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}