fansenze/parcel-transformer-url-loader

Support for Parcel v2

Closed this issue · 3 comments

The example package.json file has

"devDependencies": {
    ...
    "parcel-bundler": "^1.11.0"
    ...
}

The parcel-bundler package is deprecated now, and v2 is published in a package called parcel.

The format of the .parcelrc file changed, so using the example .parcelrc:

{
  "url-loader": {
    "exts": ["jpg", "png"],
    "limit": 66666
  }
}

Produces the following error:

@parcel/core: Invalid Parcel Config

.parcelrc:2:2
  1 | {
> 2 |   "url-loader": {
>   |   ^^^^^^^^^^^^ Possible values: "$schema", "extends", "bundler", "resolvers", "transformers", "validators", "namers", "packagers", "optimizers", "compressors", "reporters", "runtimes", "filePath", "resolveFrom"
  3 |     "exts": [
  4 |       "jpg",

Links to documentation:

i am very busy with my work recently, so i have not write some codes for the Parcel ecosystem in a long time.

i will refactor this plugin to support Parcel v2 this month.

let try it, parcel-transformer-url-loader is published for parcel v2.
the doc about usage is here.

Thank you!

I do not know how to use NPM very well, so I have not been able to test parcel-transformer-url-loader.

I wanted to add it as an option here: https://github.com/pfroud/viz.js/tree/enhance-readme#using-a-bundler

Importing still does not work, but an alternative way is provided which does work.