I followed the example file structure as described in http://requirejs.org/docs/optimization.html and got a working build. I then modified two.js to look like this:
define(["xstyle/css!app/css/main.css"], function () {
console.log("two");
});
And added xstyle/css to build.js:
({
baseUrl: "./scripts",
paths: {
dojo: "empty:",
xstyle: "empty:"
},
name: "main",
out: "main-built.js"
})
Add ran the build again:
r.js.cmd -o build.js optimize=none
And now I'm seeing this error:
Tracing dependencies for: main
TypeError: Cannot read property 'normalize' of undefined
In module tree:
main
two
Error: TypeError: Cannot read property 'normalize' of undefined
In module tree:
main
two
at Object.<anonymous> (bin\r.js:1187:35)
There are numerous references to this same error but none resolve this specific issue (e.g.):
Requirejs can't compile my dojo-dependent module
RequireJs optimizer ignore plugin
https://github.com/odoe/AGSModularDemo
Is it possible to optimize a dojo application using requirejs?