Skip to content

Commit

Permalink
fix: #331
Browse files Browse the repository at this point in the history
chore(css-compiler): minify css for the prod
  • Loading branch information
barbatus committed Aug 7, 2016
1 parent 5a976ac commit 6fe0d45
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 6 deletions.
9 changes: 7 additions & 2 deletions atmosphere-packages/css-compiler/compilers/basic_compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ BasicCompiler = class BasicCompiler {
return;
}

let resultCss = result.css;
if (!Meteor.isDevelopment) {
resultCss = CssTools.minifyCss(result.css)[0];
}

// CSS files that comes from `imports` folder
// can be downloaded as server assets.
inputFile.addAsset({
data: result.css,
data: resultCss,
path: sourcePath
});

Expand All @@ -48,7 +53,7 @@ BasicCompiler = class BasicCompiler {
// it'll appear on the client only if it's
// explicitly imported somewhere in the code base.
let css = Babel.compile(`
const css = \`${result.css}\`;
const css = \`${resultCss}\`;
module.exports.default = css;`
);
inputFile.addJavaScript({
Expand Down
3 changes: 2 additions & 1 deletion atmosphere-packages/css-compiler/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Package.onUse(function(api) {
'underscore@1.0.8',
'check@1.2.1',
'babel-compiler@6.6.4',
'barbatus:scss-compiler@3.8.1_1'
'barbatus:scss-compiler@3.8.1_1',
'minifier-css'
]);

api.addFiles([
Expand Down
2 changes: 1 addition & 1 deletion dist/data_observer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var DataObserver = (function () {
}
DataObserver.pushCb = function (callbacks) {
var _this = this;
utils_1.check(callbacks, Match.Where(utils_1.isMeteorCallbacks));
utils_1.check(callbacks, utils_1.Match.Where(utils_1.isMeteorCallbacks));
var completer = async_1.PromiseWrapper.completer();
var dequeue = function (promise) {
var index = _this._promises.indexOf(promise);
Expand Down
1 change: 1 addition & 0 deletions dist/utils.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ export declare const g: any;
export declare const gZone: any;
export declare const EJSON: any;
export declare const check: any;
export declare const Match: any;
1 change: 1 addition & 0 deletions dist/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ exports.g = typeof global === 'object' ? global :
exports.gZone = exports.g.Zone.current;
exports.EJSON = Package['ejson'].EJSON;
exports.check = Package['check'].check;
exports.Match = Package['check'].Match;
2 changes: 1 addition & 1 deletion examples/todos-meteor-1.3/.meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@1.4
METEOR@1.4.0.1
3 changes: 2 additions & 1 deletion modules/data_observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
MeteorCallbacks,
isMeteorCallbacks,
isCallbacksObject,
check
check,
Match
} from './utils';

/**
Expand Down
2 changes: 2 additions & 0 deletions modules/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ export const gZone = g.Zone.current;
export const EJSON = Package['ejson'].EJSON;

export const check = Package['check'].check;

export const Match = Package['check'].Match;

0 comments on commit 6fe0d45

Please sign in to comment.