alvis / presetter

🛹 Reuse and manage build scripts, devDependencies and config files from your favourite presets, instead of copy and paste!
MIT License
68 stars 2 forks source link

Allow removing config in override #10

Closed pcfreak30 closed 1 year ago

pcfreak30 commented 1 year ago

I found a possible edge case bug in the rollup preset where the json plugin needs to be loaded first, but besides that I cannot force it to the top or otherwise re-order the plugins in a .presetterrc.

Please advise.

Kudos.

alvis commented 1 year ago

@pcfreak30 I assume you're referring to the plugin order in this file.

Yes. Currently there is no way to add a plugin to the top of the list. Any new plugin are appended at the end of the list. However, you can redefine the plugins fields in .presetterrc. e.g.

{
  ...
  "config": {
    "rollup": {
      "plugins": {
        0: "@apply @rollup/plugin-json[default]",
        1: "@apply rollup-plugin-ts[default]",
        2: ...
      }
    }
  }
}

Hope it helps :)

pcfreak30 commented 1 year ago

Yes, I kind of have gone way beyond that since, to understand your code base. Most of these are mirrored to GitHub and under npm @lumeweb.

https://git.lumeweb.com/LumeWeb/presetter-kernel-module-preset https://git.lumeweb.com/LumeWeb/presetter-relay-plugin-preset https://git.lumeweb.com/LumeWeb/presetter-preset-rollup https://git.lumeweb.com/LumeWeb/node-library-preset.

Only other issues Ive seen so far are proper installation of dependency presets, most often strict has issues, which causes npx to break, and potentially issues with PNPM, though not heavily tested yet.

I have had to do a lot of forking to get around that limit in your merge algo.

Kudos.

alvis commented 1 year ago

@pcfreak30 Do you have any specific example regarding dependency resolution & pnpm? I had some issues related to resolving symlinks with pnpm in earlier version, but I've fixed it since. So I'm interested to know if there remains some edge cases I'm not aware of. :)