Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix for steal packages build

Fix for steal packages build producing wrong CSS mappings.  Example:

Resource.make(
{"src": "wildcat/packages/pdf.css", "has": undefined }
);

When it should be:

Resource.make(
{"src": "wildcat/packages/pdf.css", "has": ["wildcat/app/dm/pdf/pdf.css"]}
);
  • Loading branch information...
commit cc5ec61a7b73b86b8d4c0afdf7ddd63f71ca3cc6 1 parent 91f507b
@amcdnl amcdnl authored
Showing with 9 additions and 15 deletions.
  1. +4 −7 build/css/css.js
  2. +1 −4 build/js/js.js
  3. +4 −4 build/packages/packages.js
View
11 build/css/css.js
@@ -54,19 +54,16 @@ steal(function( steal ) {
}
var directory = steal.File(where).dir(),
- srcs = code = [];
+ srcs = [], codez = [];
- steals.forEach(function(stealOpts){
- code.push(convert(stealOpts.text, stealOpts.rootSrc, directory))
+ steals.forEach(function(stealOpts){
+ codez.push(convert(stealOpts.text, stealOpts.rootSrc, directory))
srcs.push(stealOpts.rootSrc+'')
});
- var raw_css = code.join("\n"),
- minified_css = css.minify(raw_css);
-
return {
srcs: srcs,
- code : minified_css
+ code : css.minify(codez.join('\n'))
}
}
//used to convert css referencs in one file so they will make sense from prodLocation
View
5 build/js/js.js
@@ -230,12 +230,9 @@ steal('steal/build/css').then(function( steal ) {
code.push( file.text, "steal.executed('"+file.rootSrc+"')" );
});
- var cssPackage = steal.build.css.makePackage(csses, cssPackage),
- cssCode = cssPackage? cssPackage.code: null;
-
return {
js: code.join(";\n") + "\n",
- css: cssCode
+ css: steal.build.css.makePackage(csses, cssPackage)
}
}
}).then('./jsminify');
View
8 build/packages/packages.js
@@ -175,7 +175,7 @@ steal('steal/build/open','steal/build/apps','steal/get/json.js',function(s){
src: packageName+".css",
has: pack.css.srcs
};
- s.URI(packageName+".css").save( filterCode(pack.css, 'css') );
+ s.URI(packageName+".css").save( filterCode(pack.css.code, 'css') );
sharing.hasCSS = true;
}
@@ -215,7 +215,7 @@ steal('steal/build/open','steal/build/apps','steal/get/json.js',function(s){
// and maps
// sort masterFiles
- s.print("Making "+to+"production.js");
+ s.print("Making "+to+"/production.js");
var pack = build.js.makePackage(
masterFiles.map(function(f){return f.stealOpts}),
@@ -232,8 +232,8 @@ steal('steal/build/open','steal/build/apps','steal/get/json.js',function(s){
mapCode = "steal.packages("+s.toJSON(maps)+");"
s.URI(to+"/production.js").save( filterCode(mapCode+makeCode.join('\n')+"\n"+pack.js, 'js') );
if(pack.css){
- s.print(" "+to+"production.css");
- s.URI(to+"/production.css").save( filterCode(pack.css, 'css') );
+ s.print(" "+to+"/production.css");
+ s.URI(to+"/production.css").save( filterCode(pack.css.code, 'css') );
}
});
});

6 comments on commit cc5ec61

@fabioscala

That "pack.css.code" change gives me a syntax error in cssminify.js, var css is undefined. Don't really know what it actually does, but changed it back to pack.css in my application for css build to work..

@fabioscala

And the css.minify(codez.join('\n')) seems to result in a different production.css than before (at least for me)? something is kinda wrong..

@moschel

i'll look into this shortly

@amcdnl

@fabioscala What type of build ( e.g. pluginify, packages, etc ) are you running that the error occurs in?

@moschel

Should be fixed now in all cases (tried pluginify, apps, standalone build). Please give it a try and let me know.

@fabioscala

@amcdaniel2: normal steal build to production.js and production.css, no packages, no special steal options for files

@moschel: Build works again, thanks!

Still the css.minify(codez.join('\n')) produces a different production.css which results in the page looking different/wrong. What exactly was that change for? If I remove that specific change the css gets minified too, meaning that minification is called multiple times anyway? (and maybe that's actually what cripples my css)

Btw is there a reason why jsminify.js uses //@steal-remove-start/end and not //!steal-remove-start/end. I thought it was changed to ! quite some time ago and all other jsmvc resources actually use ! too so with the current jsminify.js, dev code blocks don't really get removed.

Please sign in to comment.
Something went wrong with that request. Please try again.