Skip to content

Commit ef61b9f

Browse files
committed
sort generated css alphabeticaly
1 parent e4860cd commit ef61b9f

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

assets/js/bundle.js

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/packer.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,20 @@ Packer.prototype = {
100100
canvas.width = width;
101101
canvas.height = height;
102102
ctx.clearRect(0, 0, canvas.width, canvas.height);
103+
104+
// sort blocks alphabetically
105+
blocks.sort(function(a,b){
106+
var nameA = a.name.toUpperCase();
107+
var nameB = b.name.toUpperCase();
108+
return (nameA < nameB) ? -1 : (nameA > nameB) ? 1 : 0;
109+
});
110+
103111
for (var n = 0; n < blocks.length; n++) {
104112
b = blocks[n];
105113
if (b.fit) {
106114
// turn on for testing
107-
//ctx.fillRect(b.fit.x + p, b.fit.y + p, b.w, b.h);
108-
//ctx.stroke();
115+
// ctx.fillRect(b.fit.x + p, b.fit.y + p, b.w, b.h);
116+
// ctx.stroke();
109117
ctx.drawImage(b.img, b.fit.x + p, b.fit.y + p);
110118
// add comma if not the last style
111119
groupSelectors += '.' + this.prefix + b.name + (n === blocks.length - 1 ? ' ' : ', ');

webpack.config.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
var path = require('path');
2-
3-
var phaserModule = path.join(__dirname, '/node_modules/phaser-ce/');
4-
var phaser = path.join(phaserModule, 'build/custom/phaser-split.js');
5-
var pixi = path.join(phaserModule, 'build/custom/pixi.js');
6-
var p2 = path.join(phaserModule, 'build/custom/p2.js');
71

82
var config = {
93
context: __dirname + "/assets",

0 commit comments

Comments
 (0)