Hi,
I'm trying to learn how to use the Javascript Maven Plugin, but I've had
lots of issues I would like to fix one at a time.
So my first failed attempt: I have a build that works on the first try, but
deletes require.js in the process so that subsequent builds fail. My
directory structure is vanilla AFAICT, except that require.js is located at
<project root>/deps/require.js. My pom.xml is vanilla.
I'm not using almond.js in this revision. The file <project
root>/src/main/resources/game.html has this script:
<script data-main="../js/main.js" src="../../../deps/require.js"></script>
and /src/main/js/main.js looks like this:
/*global requirejs define */
(function() {
var jsSourceRoot = "../../main/js"; // root of js code, excluding 3rd-party
and test code.
requirejs.config({
//By default load any module IDs from js/lib
baseUrl: jsSourceRoot,
paths: { Box2dWeb: '../../../deps/Box2dWeb-2.1.a.3/Box2dWeb-2.1.a.3.min',
physicsService: jsSourceRoot + '/Box2dWebPhysics', renderingService:
jsSourceRoot + '/Box2dWebDebugRendering'
}
});
define('canvas', document.getElementById("canvas"));
define('drawScale', 50.0);
}());
// Start the main app logic.
requirejs(['game'],
function (game) {
game.start();
});
Does that give enough info? The complete source code is at
685c64f<https://bitbucket.org/apollodude217/jsgame/commits/685c64f2b6b87fb4012460f1d65a5ff32e238a0d>
.
Why would the build process delete a file it didn't create? Am I doing
something invalid / unsupported?