ember.js - How can I speed up development builds while developing a linked package? (Ember/Broccoli) -
my broccoli builds take lot of time. ~30 seconds build every time change line of js (i mean incremental re-builds dev server running, not complete build).
here's situation. have project ember addon project b npm link
in. i'm developing project a, running ember server
on project b.
every single time make change line of javascript in project , rebuild, see following files change in project b:
b/dist/assets/vendor.css b/dist/assets/vendor.js b/dist/assets/vendor.map b/dist/assets/b.css b/dist/assets/b.css.map
my concern that, because i'm developing linked package, broccoli configuration such entire node_modules
recombined vendor files.
is there way me configure ember/broccoli use separate file compile , segregate rest of vendor.js
? b/dist/assets/a.min.css
, b/dist/assets/a.min.js
example?
...or i'm guessing @ cause of problem incorrectly?
thank in advance!
edit: here's info requested
slowest nodes (totaltime => 5% ) | total (avg) ----------------------------------------------+--------------------- concat (11) | 39239ms (3567 ms) recastfilter (280) | 33127ms (118 ms) babel (233) | 14099ms (60 ms) eslintvalidationfilter (5) | 12632ms (2526 ms) lesscompiler (46) | 7191ms (156 ms) slowest nodes (totaltime => 5% ) | total (avg) ----------------------------------------------+--------------------- sourcemapconcat: concat: vendor /asset... (1) | 36270ms lesscompiler (46) | 4029ms (87 ms)
here's index.js (of project a):
const engineaddon = require('ember-engines/lib/engine-addon'); const treemerger = require('broccoli-merge-trees'); const lesscompiler = require('broccoli-less-single'); const funnel = require('broccoli-funnel'); const path = require('path'); module.exports = engineaddon.extend({ name: 'ember-engine-admin-ui', lazyloading: false, treeforvendor(tree) { let addontree = this.treegenerator(path.resolve(this.root, this.options.trees.addon)); let compiledlesstree = new lesscompiler(addontree, 'styles/addon.less', `styles/${this.name}.css`); let sidebarcsstree = new funnel(path.dirname(require.resolve('sidebar-v2/css/leaflet-sidebar.css')), { files: ['leaflet-sidebar.css'], destdir: 'styles' }); let sidebarjstree = new funnel(path.dirname(require.resolve('sidebar-v2/js/leaflet-sidebar.js')), { files: ['leaflet-sidebar.js'], destdir: 'js' }); return new treemerger([tree, compiledlesstree, sidebarcsstree, sidebarjstree]); }, included() { this._super.included.apply(this, arguments); this.import(`vendor/styles/${this.name}.css`); this.import('vendor/js/leaflet-sidebar.js'); this.import('vendor/styles/leaflet-sidebar.css'); }, isdevelopingaddon() { return true; } });
Comments
Post a Comment