Skip to content

Bring static resources to JavaScript.

License

Notifications You must be signed in to change notification settings

resource-sentry/core

Repository files navigation

Recource Sentry Logo

Version Dependencies

Bring static resources (SCSS, JSON, XML, Property Files, etc.) to JavaScript. The modular architecture where every static resource could be interpreted differently.

Table of contents:

Motivation

Multi-language support? Project variables. Style variables. What if you want utilize power of namespaces in XML to build a collaborative source for multi-language support? What if you want to store style-related variables in SCSS, but you need to make some computation in runtime. Most of the data formats are not supported by browsers, - solution is to compile resources before code will be executed on user's machine and use "resources" as an efficient JavaScript code.

Configuration

The main configuration is an Object. Configuration can be provided as a rs.config.js file. Every configuration should include the root property config and optional settings.

Example:

module.exports = {config: {}, settings: {}};

Config

Required. Determines about readers and writers.

  • input <Array>, list of reader instances
  • output <Writer>, instance of a writer

Settings

Optional. Determines behavior of the tool.

  • watch <Boolean|Object>, enables file watcher for reader inputs. Object could be used to provide Chokidar options.

Convention

Custom readers and writers should use the same prefix.

  • Reader: rs-reader-xxx. Example: rs-reader-fast-xml
  • Writer: rs-writer-xxx. Example: rs-writer-es3