Skip to content

Instantly share code, notes, and snippets.

@johnyanarella
Created August 31, 2012 11:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnyanarella/3551608 to your computer and use it in GitHub Desktop.
Save johnyanarella/3551608 to your computer and use it in GitHub Desktop.
Configuring Ext JS's Loader to load individual Deft JS files during development.
<!DOCTYPE HTML>
<html>
<head>
<title>Example Application</title>
<link rel="stylesheet" type="text/css" href="lib/extjs-4.1.0/resources/css/ext-all.css"/>
<script type="text/javascript" src="lib/extjs-4.1.1/ext-dev.js"></script>
<script type="text/javascript">
Ext.Loader.setConfig({
enabled: true,
paths: {
'Ext': 'lib/extjs-4.1.1/src',
'Deft': 'lib/deftjs-0.8.0pre/src/js/Deft'
}
});
// TODO: Your application's startup logic.
</script>
</head>
<body>
</body>
</html>
@johnyanarella
Copy link
Author

This will configure Ext JS's Loader to load the individual Deft JS class files.

Then, when you create your deployment build via the Sencha SDK Tools (http://www.sencha.com/products/sdk-tools), only the Deft classes you actually use will be pulled into the .JS3B and final minified build.

NOTE: This only works for Deft JS v0.8.0preview and above (currently in the 'master' branch of the Deft JS GitHub repository), as prior versions were missing some necessary require statements.

@johnyanarella
Copy link
Author

Correction: .JSB3 rather than .JS3B

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment