phenomejs / phenome

The ultimate cross-framework component compiler
http://phenomejs.org
MIT License
71 stars 8 forks source link

Control-comments / comment commands #31

Closed nolimits4web closed 6 years ago

nolimits4web commented 6 years ago

I think we still need control comments to control some of compiler behavior. We may need some conditions in component code based on target framework. For most of the parts environment vars will be enough, but we can’t do it with imports, when we may need different assets for different frameworks. Something like eslint has:


// phenome-line-vue
// phenome-next-line-react 
nolimits4web commented 6 years ago

Fixed with #9dc2113

Added support for following command comments:

// phenome-{compiler}-line
// phenome-{compiler}-next-line

e.g.


thisCodeWillBeOnlyInVueComponent // phenome-vue-line
// phenome-react-next-line
thisCodeWillBeOnlyInReactComponent