Support for CSS/JavaScript processors
Opened this issue · 0 comments
hagenburger commented
Define a way to integrate processors for CSS and JavaScript. Those could be: PostCSS, Sass/SCSS, Less, Coffee-Script, Babel, …
Current situation
CSS and JavaScript can be added via:
document.contents.add('css', 'a { color: blue }')
document.contents.add('javascript', 'alert("Hello world")')
And retrieved via:
document.contents.get('css')
document.contents.get('javascript')
Pre processors
Languages that require a preprocessor (for example Sass, SCSS, Less, Coffee-Script), must use their own content type:
document.contents.add('scss', 'a { color: lighten(blue, 10%) }')
Those need a hook to be converted into either CSS or JavaScript before rendering the document.
“Post” processors
Autoprefixer and BabelJS should convert either CSS or JavaScript after the pre processors have been converted and before the document gets rendered.
Open questions
- Where and how to define them?