I'm working on Crossrider extension, I'm new in extension development. I've create basic project based on demos and even included Jasmine for testing. Unfortunately I stucked on creating own resources.
Here's my debug project's structure:
resources\
lib\
spec\
test-runner.js
src\
js\
App.js
popup.html
background.js
extension.js
test-runner.js:
(function() {
appAPI.resources.includeCSS('lib/jasmine/jasmine.css');
appAPI.resources.includeJS('lib/jasmine/jasmine.js');
appAPI.resources.includeJS('lib/jasmine/jasmine-html.js');
appAPI.resources.includeJS('lib/jasmine/boot.js');
$('body').html('');
appAPI.resources.includeJS('spec/App-spec.js');
})();
And here it is how I include this file:
appAPI.resources.includeJS('spec/test-runner.js');
And everything works fine.
Problems start when I'm trying to include App.js. I read that it should be done like this:
appAPI.resources.addInlineJS('src/js/App.js');
But it's not working.
Here's my App.js:
var App = {
init: function() {
console.log('App initialized');
}
};
$(document).ready(App.init);
Is it possible to include resources files inside extension.js or background.js, and also how to add more js files to project resources?