0

I have my own nodejs web application which is using Parcel 2 to bundle the resources.

{
  "name": "acme-web-app",
  "version": "0.0.1",
  "description": "",
  "keywords": [],
  "license": "",
  "author": "",
  "scripts": {
    "build": "parcel build index.html",
    "dev": "parcel index.html --open",
    "start": "npm run build && npm run dev",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "devDependencies": {
    "@parcel/packager-raw-url": "^2.6.0",
    "@parcel/transformer-sass": "^2.6.0",
    "@parcel/transformer-webmanifest": "^2.6.0",
    "parcel": "^2.6.0",
    "sass": "^1.52.2"
  }
}

All works fine - the js bundles end up in a dist folder.

I am contemplating whether it is possible to write a parcel plug-in within this project is executed when the build script is run.

Is it possible - or does every reference need to go through npm channels via devDependencies?

I haven't figured a starting point for this - and have not been able to find what I am looking for on google so hopefully, the question makes sense.

NOTE: I have only really built web applications with nodejs.

Andrew Stegmaier
  • 3,429
  • 2
  • 14
  • 26
Andez
  • 5,588
  • 20
  • 75
  • 116
  • Struggled to find the docs earlier. I suggest I should start here https://parceljs.org/plugin-system/overview/ – Andez Jun 09 '22 at 20:07
  • What are you trying to accomplish with the plugin / `build` script? – Andrew Stegmaier Jun 10 '22 at 01:24
  • I was contemplating asking a different question which seemingly has already been asked on parcel's git issues - with no good responses. Its just packaging up static files like the robots.txt etc - without bundling them. Which has some plugins done for v2 - here - https://github.com/elwin013/parcel-reporter-static-files-copy – Andez Jun 10 '22 at 07:27
  • But for now - I just want to learn to write a plugin in parcel - just for experimentation. So without creating a build/test setup for the extension - just going to hack something in my webapp project. – Andez Jun 10 '22 at 07:31

0 Answers0