Permalink
Browse files

Optimize CSS in built-require.js.

Right now relative @imports that bring in CSS from subdirectories
not directly under the current one seem to not get automatically
inlined, but as far as I can tell, this seems to be a bug with
requirejs/r.js, not the way we're using it.
  • Loading branch information...
1 parent a17fe64 commit 9100b702972661ebdd7181a1261607e80555d7fc @toolness toolness committed Aug 27, 2012
Showing with 9 additions and 2 deletions.
  1. +1 −0 .gitignore
  2. +7 −1 build-require.js
  3. +1 −1 examples/bare-optimized.html
View
@@ -1,2 +1,3 @@
js/friendlycode-built.js
+css/friendlycode-built.css
node_modules/
View
@@ -59,7 +59,13 @@ if (!module.parent) {
// included.
console.log("Done. About " + buildResponse.split('\n').length +
" modules are inside the generated JS file.");
- process.exit();
+ requirejs.optimize({
+ cssIn: "css/friendlycode.css",
+ out: "css/friendlycode-built.css"
+ }, function() {
+ console.log("Optimized CSS.");
+ process.exit();
+ });
});
}
}
@@ -5,7 +5,7 @@
<base target="_blank">
<title>Optimized Barebones Friendlycode Editor</title>
- <link rel="stylesheet" href="../css/friendlycode.css">
+ <link rel="stylesheet" href="../css/friendlycode-built.css">
</head>
<body style="margin: 0">
<div id="bare-fc-holder" class="friendlycode-loading"></div>

0 comments on commit 9100b70

Please sign in to comment.