Permalink
Browse files

$js to requirejs

  • Loading branch information...
takion committed May 6, 2017
1 parent 46bb3de commit 06c9b50524b18e5bc0a0d815e04d46debaab7ad4
Showing with 59 additions and 8 deletions.
  1. +4 −7 app/.xtml
  2. 0 app/app.js
  3. +54 −0 app/require-config.js
  4. +1 −1 composer.json
@@ -35,16 +35,13 @@
</a>
</div>
</footer>
<script type="text/javascript" src="vendor/bower-asset/js/js.js"></script>
<script type="text/javascript" src="js/js.alias-asset.js"></script>
<script type="text/javascript">var APP_DEV_MODE = true;</script>
<script type="text/javascript" src="vendor/bower-asset/requirejs/require.js"></script>
<script type="text/javascript" src="app/require-config.js"></script>
<script type="text/javascript">
<?if($templix->devJs):?>$js.dev=true;<?endif;?>$js.min=true;
<?if(is_file(REDCAT_CWD.'js/script.js')):?>
$js('js/script<?=$VERSIONING?>');
<?endif;?>
<?if($redcat->dev['chrono']):?>
if(console) console.info('<?=RedCat\Debug\Chrono::output()?>');
<?endif;?>
</script>
</body>
</html>
</html>
No changes.
@@ -0,0 +1,54 @@
(function(){
const main = ['app/app'];
const dev = APP_DEV_MODE;
//alias map
const alias = {
};
//combined dependencies
const combined = {
};
//dependencies map
const dependencies = {
};
if(!dev){
//don't add min suffix for
const dontMin = [
];
Object.keys(paths).forEach(function(name){
if(dontMin.indexOf(name)===-1&&dontMin.indexOf(paths[name])===-1){
paths[name] += '.min';
}
});
}
require.config({
paths : alias,
shim : dependencies,
urlArgs : dev?'_='+(new Date()).getTime():'',
});
Object.keys(combined).forEach(function(name){
define(name, combined[name], function(){
return arguments;
});
});
require(main);
})();
@@ -29,7 +29,7 @@
"redcatphp/artist": "^2.1",
"redcatphp/framework": "^2.5",
"redcatphp/autoload": "@dev",
"bower-asset/js": "@dev",
"bower-asset/requirejs": "@dev",
"bower-asset/easyfont-source-code-pro": "@dev",
"bower-asset/font-awesome": "@dev"
},

0 comments on commit 06c9b50

Please sign in to comment.