redOctober13
redOctober13

Reputation: 3974

Using ember-cli, should I "serve" or "build"?

I'm on Windows 7, ember-cli version 40. Every time I make code changes I have to quit the server and restart it as I get Broccoli "ENOENT" errors for the tmp directory every time I save some changes.

The modus operandi for the past few days has just been to Ctrl+c, then do ember server again. Build times are over 100 seconds. So I'm wondering if I should be doing ember build at some point, then ember server or if anyone knows why Broccoli won't rebuild automatically like it's supposed to. This is a small project right now, only a couple dependencies, but I just deleted over 6GB from the tmp folder because new stuff kept getting copied there.

EDIT

I upgraded to ember-cli version 42, and times on Windows 7 are down to 22sec or so, which is a big improvement

My Brocfile.js:

/* global require, module */

var pickFiles = require('broccoli-static-compiler');
var mergeTrees = require('broccoli-merge-trees');
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var fontTree;
var app = new EmberApp();

fontTree = pickFiles('vendor/fontawesome/fonts', {
  srcDir: '/',
  files: ['*'],
  destDir: '/assets/fonts'
});
// Use `app.import` to add additional libraries to the generated
// output files.
app.import('bower_components/bootstrap-sass-official/vendor/assets/javascripts/bootstrap.js');
app.import('bower_components/moment/moment.js');

//module.exports = mergeTrees([app.toTree(), fontTree]);
module.exports = app.toTree();

Upvotes: 4

Views: 2117

Answers (4)

Dan Mitchell
Dan Mitchell

Reputation: 715

In newer versions of ember-cli (0.1.0) and up, I think), if you run your "ember serve" command window as administrator, a bunch of other speedups come in because now it can use symbolic links rather than copying, and at that point build times on Windows come down to the same speed as on unix/osx. (see http://www.ember-cli.com/#symlinks-on-windows)

Upvotes: 0

redOctober13
redOctober13

Reputation: 3974

I just upgraded my app to ember-cli v 0.0.42, and right away saw my ember server times drop to around 20 seconds, which is still pretty slow, but much better than 180 and seems to indicate the team made some fixes that improved the Windows speed. I know the majority of the web dev community is on Apple machines, so I expect Windows support to lag, it's just the nature of the thing, which is ok.

Upvotes: 0

Jason Olson
Jason Olson

Reputation: 3696

This is an issue others have reported. There are perf problems on Windows due to Windows indexing/search. If you disable this, you should restore much of your perf. Somebody else mentioned as well that it resolved this ember serve issue for them: https://github.com/stefanpenner/ember-cli/issues/1253

Some other links for you: - Slow build time in Windows Environment - Improve Windows experience

Upvotes: 2

Sam Selikoff
Sam Selikoff

Reputation: 12694

100 seconds for a small project? You should definitely investigate the error. Typically, you just run ember server, and the project rebuilds when files change. Rebuilds for big projects can get upwards of 7-10 seconds, but usually that's because of a large dependency.

I would encourage you to explore the ENOENT error. Also, drop in #ember-cli on IRC (freenode) and ask there.

Upvotes: 2

Related Questions