neutralinojs / neutralinojs-cli

neu cli for Neutralinojs
https://neutralino.js.org/docs/cli/neu-cli
MIT License
91 stars 57 forks source link

resourcePath bundler: ignore certain file extensions #218

Closed 0x42656E closed 4 months ago

0x42656E commented 2 years ago

Right now, neu build bundles all files from the resourcePath(provided in neutralino.config.json) into one resources.neu file. Thereby, files can be included that have no use there (like TypeScript files). It would be very handy if there was an option in the neutralino.config.json to ignore certain file extensions.

here an example:

{
 "cli": {
  "binaryName": "neutralino",
  "resourcesPath": "/resources/",
  "resourcesIgnore": [".ts", "*.scss", "sandbox.js"],
  "extensionsPath": "/extensions/",
  "extensionsIgnore": ["*.ts", ".gitignore", "randomFileInExtensionFolderThatWeDon'tWantBundled.extension"],
  "clientLibrary": "/resources/js/neutralino.js",
  "binaryVersion": "4.6.0",
  "clientVersion": "3.5.0"
 }
}

Of course it can be implemented differently, e.g. in a .neuignore file, but I think it is more convenient to have everything in one configuration file, like in the example above.

.neuignore

/myCoolResources/*.ts
/extensions/*.mjs

Thanks and have great day! :slightly_smiling_face:

shalithasuranga commented 4 months ago

Thanks so much for reporting this issue. This is implemented and will be released with the next release. Now, we can exclude files from app bundle and extensions directory as follows:

    "resourcesExclude": ".*\\.scss$|.*\\.d.ts$",
    "extensionsExclude": ".*\\.log$",

Thanks :tada: