Skip to content

Commit

Permalink
Add dev optimization for defaults addons
Browse files Browse the repository at this point in the history
Add result of dev optimization for defaults addons
  • Loading branch information
SamyPesse committed Nov 12, 2013
1 parent 053c6ee commit 832cdac
Show file tree
Hide file tree
Showing 7 changed files with 232 additions and 1 deletion.
179 changes: 179 additions & 0 deletions addons/editor/addon-built.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions addons/manager/addon-built.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions addons/monitor/addon-built.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions addons/settings/addon-built.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 33 additions & 0 deletions addons/terminal/addon-built.js

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion core/cb.addons/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,16 @@ function setup(options, imports, register, app) {

// Copy defaults addons
var copyDefaultsAddons = function() {
return loadAddonsInfos(configDefaultsPath).then(runAddonsOperation(function(addon) {
var first = loadAddonsInfos(configDefaultsPath);

if (options.dev) {
logger.log("Optmize defaults addons for production");
first = first.then(runAddonsOperation(function(addon) {
return addon.optimizeClient();
}));
}

return first.then(runAddonsOperation(function(addon) {
logger.log("Adding default addon", addon.infos.name);
return addon.transfer(configAddonsPath);
}));
Expand Down
7 changes: 7 additions & 0 deletions core/codebox.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ var start = function(config) {
'root': process.env.WORKSPACE_DIR || process.cwd(),
'title': process.env.WORKSPACE_NAME,
'public': process.env.WORKSPACE_PUBLIC != "false",
'dev': process.env.DEV != null,

'hooks': {
// Hooks could be:
Expand Down Expand Up @@ -53,6 +54,11 @@ var start = function(config) {
config.title = path.basename(config.root)
}

// Is dev mode
if (config.dev) {
console.log("WARNING! your codebox is in dev mode");
}

// The root of our plugins
var pluginPath = path.resolve(
__dirname
Expand Down Expand Up @@ -94,6 +100,7 @@ var start = function(config) {
'packagePath': "./cb.addons",

// Options
'dev': config.dev,
'path': config.addons.path,
'tempPath': config.addons.tempPath,
'defaultsPath': config.addons.defaultsPath
Expand Down

0 comments on commit 832cdac

Please sign in to comment.