cesanta / mongoose-os

Mongoose OS - an IoT Firmware Development Framework. Supported microcontrollers: ESP32, ESP8266, CC3220, CC3200, STM32F4, STM32L4, STM32F7. Amazon AWS IoT, Microsoft Azure, Google IoT Core integrated. Code in C or JavaScript.
https://mongoose-os.com
Other
2.51k stars 429 forks source link

Removing files from the filesystem #527

Closed dimitrov-adrian closed 4 years ago

dimitrov-adrian commented 4 years ago

Is there a way to remove specific files that comes from libraries, from the filesystem. I found https://github.com/mongoose-os-libs/mjs/issues/5, but it seems to doesn't works at all.

For example, I would like to completely remove polyfill.js, api_i2c.js, api_bitbang.js and etc.

rojer commented 4 years ago

currently there is no way to do that. the list is actually passed from mos utility during build - it performs expansion of passes the list down. a flag could be added to perform filtering to exclude files.

kzyapkov commented 4 years ago

Recent versions of mos support fs_filters which can be used to control contents of the filesystem, ex:

fs_filters:
  - include: "index.html*"
  - include: "init.js"
  - include: "api_math.js"
  - include: "api_events.js"
  - include: "api_http.js"
  - include: "api_net.js"
  - include: "api_timer.js"
  - include: "api_rpc.js"
  - include: "api_esp32.js"
  - include: "api_file.js"

  - exclude: "api_*"
  - exclude: "polyfill.js"