diff --git a/app/app.js b/app/app.js index 8d66b958..bf84f877 100644 --- a/app/app.js +++ b/app/app.js @@ -1,5 +1,5 @@ import Ember from 'ember'; -import Resolver from 'ember/resolver'; +import Resolver from 'ember-resolver'; import loadInitializers from 'ember/load-initializers'; import config from './config/environment'; diff --git a/app/services/ember-cli.js b/app/services/ember-cli.js index 51f82dbe..060b31b7 100644 --- a/app/services/ember-cli.js +++ b/app/services/ember-cli.js @@ -367,8 +367,8 @@ function contentForAppBoot (content, config) { // doesn't recognize them properly... var monkeyPatchModules = [ 'ember', - 'ember/resolver', - 'ember/load-initializers' + 'ember/load-initializers', + 'ember-resolver/resolver' ]; if ("ember-data" in config.dependencies) { @@ -392,4 +392,3 @@ function contentForAppBoot (content, config) { function calculateAppConfig(config) { return JSON.stringify(config.APP || {}); } - diff --git a/bower.json b/bower.json index 22d75623..79241eea 100644 --- a/bower.json +++ b/bower.json @@ -8,7 +8,6 @@ "ember-load-initializers": "ember-cli/ember-load-initializers#0.1.5", "ember-qunit": "0.4.9", "ember-qunit-notifications": "0.0.7", - "ember-resolver": "~0.1.18", "jquery": "^1.11.3", "loader.js": "ember-cli/loader.js#3.2.1", "qunit": "~1.18.0", diff --git a/ember-cli-build.js b/ember-cli-build.js index 50c0cc24..bc2c51ca 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -5,6 +5,7 @@ module.exports = function() { var concat = require('broccoli-concat'); var mergeTrees = require('broccoli-merge-trees'); var pickFiles = require('broccoli-static-compiler'); + var babelTranspiler = require('broccoli-babel-transpiler'); var env = EmberApp.env(); var isProductionLikeBuild = ['production', 'staging'].indexOf(env) > -1; var prepend = null; @@ -58,12 +59,23 @@ module.exports = function() { destDir: '/assets' }); - var twiddleVendorTree = concat(funnel('bower_components'),{ + var bowerTree = funnel('bower_components'); + var baseResolverTree = funnel('node_modules/ember-resolver/addon', { + destDir: 'ember-resolver' + }); + + var transpiledResolverTree = babelTranspiler(baseResolverTree, { + loose: true, + moduleIds: true, + modules: 'amdStrict' + }); + + var twiddleVendorTree = concat(mergeTrees([bowerTree, transpiledResolverTree]), { inputFiles: [ 'loader.js/loader.js', - 'ember-resolver/dist/modules/ember-resolver.js', 'ember-cli-shims/app-shims.js', 'ember-load-initializers/ember-load-initializers.js', + 'ember-resolver/**/*.js' ], outputFile: '/assets/twiddle-deps.js', }); @@ -96,6 +108,12 @@ function getEmberCLIBlueprints() { fileMap[blueprintName] = fs.readFileSync(filePath).toString(); } + // ember-cli 1.13.x uses ember/resolver + fileMap['app'] = fileMap.app.replace('\'ember/resolver\'', '\'ember-resolver/resolver\''); + + // ember-cli 2.x uses ember-resolver + fileMap['app'] = fileMap.app.replace('\'ember-resolver\'', '\'ember-resolver/resolver\''); + fileMap['twiddle.json'] = fs.readFileSync('blueprints/twiddle.json').toString(); fileMap['initializers/router'] = fs.readFileSync('blueprints/router_initializer.js').toString(); fileMap['initializers/mouse-events'] = fs.readFileSync('blueprints/mouse_events_initializer.js').toString(); diff --git a/package.json b/package.json index f9c74f43..7efec3b6 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "license": "MIT", "devDependencies": { "broccoli-asset-rev": "^2.1.2", + "broccoli-babel-transpiler": "^5.4.5", "broccoli-concat": "0.0.13", "broccoli-funnel": "0.2.8", "broccoli-merge-trees": "0.2.3", @@ -61,6 +62,7 @@ "ember-lodash": "0.0.5", "ember-moment": "4.0.1", "ember-notify": "4.0.1", + "ember-resolver": "^2.0.3", "ember-responsive": "1.1.1", "ivy-codemirror": "~1.2.0", "torii": "^0.6.0" diff --git a/tests/helpers/resolver.js b/tests/helpers/resolver.js index 28f4ece4..e659e27d 100644 --- a/tests/helpers/resolver.js +++ b/tests/helpers/resolver.js @@ -1,4 +1,4 @@ -import Resolver from 'ember/resolver'; +import Resolver from 'ember-resolver'; import config from '../../config/environment'; var resolver = Resolver.create();