Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please provide an example how to console.log "Hello World" through Plugin API [docs] #9502

Closed
projektorius96 opened this issue Jan 23, 2024 · 2 comments

Comments

@projektorius96
Copy link

🙋 feature request

I was scrolling the docs for Parcel Plugin development, however Parcel docs provide only generic example how to extend .parcelrc . It's like Google docs for Chrome extension development without a simplest example how to make one, just the reference. I simply don't get it, guys, how do you think we will now how to put things in a right place a plugin to work ? We desperately need an example even the simplest one !

🤔 Expected Behavior

Consider your own provided example, but a little bit modified, just as follows:

// .parcelrc
{
  "extends": ["@parcel/config-default", "@placeholder/hello-world"]
}

😯 Current Behaviour

N/A

💁 Possible Solution

N/A

🔦 Context

N/A

💻 Examples

Following Parcel API docs I managed to find this, just at the top of the page as follows:

import {Parcel} from '@parcel/core';

let bundler = new Parcel({
  entries: 'a.js',
  defaultConfig: '@parcel/config-default'
});

Judging the code above, our so called @placeholder/hello-world plugin is merged into @parcel/config-default . Perhaps I get that part right, but then my question is as follows:

How to export @placeholder/hello-world and what signature to follow to get that Hello World printed but through means of Plugin API ? In other words, I don't see how @placeholder/hello-world reflects in the codebase, simply put – no example !

I am kindly requesting to update the docs with the example explaining how to hook our @placeholder/hello-world and what entry point to use (if any) in Parcel API config.

Cheers ♥

@projektorius96
Copy link
Author

Inactive, so closing. Please re-open, if you need.

@mischnic
Copy link
Member

In "defaultConfig" you should specify a parcelrc file or a config package as described on https://parceljs.org/plugin-system/configuration/.

The individual plugins are then specified in there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants