Skip to content

Commit 372ed35

Browse files
committed
Ensure we are using the Builder from the project's version of ember-cli
In an `npm link` situation, the way we were requiring builder would load the builder from the devDepencies of this plugin, which can be a problem if it is not the same as the project's version.
1 parent ed472da commit 372ed35

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module.exports = {
2121
var outputPath = this.readConfig('outputPath');
2222
var buildEnv = this.readConfig('environment');
2323

24-
var Builder = require('ember-cli/lib/models/builder');
24+
var Builder = this.project.require('ember-cli/lib/models/builder');
2525
var builder = new Builder({
2626
ui: this.ui,
2727
outputPath: outputPath,

tests/unit/index-nodetest.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,12 @@ describe('build plugin', function() {
111111

112112
context = {
113113
ui: mockUi,
114-
project: { name: function() { return 'test-project'; }, addons: [], root: 'tests/dummy' },
114+
project: {
115+
name: function() { return 'test-project'; },
116+
require: function(mod) { return require(mod); },
117+
addons: [],
118+
root: 'tests/dummy'
119+
},
115120
config: {
116121
build: {
117122
buildEnv: 'development',

0 commit comments

Comments
 (0)