From 2b3b7d57f2a66be05412b980f2eaf642f9d60206 Mon Sep 17 00:00:00 2001 From: Sergey Astapov Date: Sat, 24 Oct 2020 13:53:47 -0400 Subject: [PATCH] Test addon against Embroider --- .travis.yml | 2 ++ config/ember-try.js | 10 ++++++++++ ember-cli-build.js | 10 ++++++++++ 3 files changed, 22 insertions(+) diff --git a/.travis.yml b/.travis.yml index b1858a3..569dba0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,7 @@ jobs: fast_finish: true allow_failures: - env: EMBER_TRY_SCENARIO=ember-canary + - env: EMBER_TRY_SCENARIO=embroider-tests include: # runs linting and tests with current locked deps @@ -47,6 +48,7 @@ jobs: - env: EMBER_TRY_SCENARIO=ember-canary - env: EMBER_TRY_SCENARIO=ember-default-with-jquery - env: EMBER_TRY_SCENARIO=ember-classic + - env: EMBER_TRY_SCENARIO=embroider-tests before_install: - curl -o- -L https://yarnpkg.com/install.sh | bash diff --git a/config/ember-try.js b/config/ember-try.js index f1a7c1e..1eaa212 100644 --- a/config/ember-try.js +++ b/config/ember-try.js @@ -85,6 +85,16 @@ module.exports = async function() { edition: 'classic' } } + }, + { + name: 'embroider-tests', + npm: { + devDependencies: { + '@embroider/core': '*', + '@embroider/webpack': '*', + '@embroider/compat': '*', + }, + }, } ] }; diff --git a/ember-cli-build.js b/ember-cli-build.js index dc5a39e..3805e25 100644 --- a/ember-cli-build.js +++ b/ember-cli-build.js @@ -13,6 +13,16 @@ module.exports = function(defaults) { This build file does *not* influence how the addon or the app using it behave. You most likely want to be modifying `./index.js` or app's build file */ + if ('@embroider/webpack' in app.dependencies()) { + const { Webpack } = require('@embroider/webpack'); // eslint-disable-line + return require('@embroider/compat') // eslint-disable-line + .compatBuild(app, Webpack, { + staticAddonTestSupportTrees: true, + staticAddonTrees: true, + staticHelpers: true, + staticComponents: true, + }); + } return app.toTree(); };