View examples
HTML
INPUT
<div>
<h1>Title</h1>
<p>Paragraph</p>
</div>
OUTPUT
<div><h1>Title</h1><p>Paragraph</p></div>
HTML Import
CSS | Sass
INPUT
div {
display: flex;
}
OUTPUT
div{display:-webkit-box;display:-webkit-flex;display:-moz-box;display:-ms-flexbox;display:flex}
PHP | PHTML
INPUT
<?
$var = 'text'
?>
<div>
<?=$var?>
</div>
OUTPUT
<?php $var='text'?><div><?=$var?></div>
Apache (.htaccess, php.ini)
INPUT
# comment
<Directory /var/www/>
# another comment
Options Indexes FollowSymLinks MultiViews
</Directory>
OUTPUT
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
</Directory>
Strings Replacement
- You can create an easy to read code and on compiling, replace the specified strings, for example:
.swrc.js
{
strings: {
'*token*': {
start: '123',
build: '456'
},
'*site-name*': {
start: 'dev.weslley.io',
build: 'weslley.io'
}
}
}
INPUT
<?
$_POST['*token*'];
$site = '*site-name*';
OUTPUT DEV (npx sw)
<?php $_POST['123'];$site='dev.weslley.io';
OUTPUT BUILD (npx sw build)
<?php $_POST['456'];$site='weslley.io';
- Works for any language that is enabled in
.swrc.js
Miscellaneous Files
- Only uploads the original file to the output directories