Skip to content

Commit

Permalink
No more Browserify
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreeman committed Jun 11, 2018
1 parent a1d1035 commit e779359
Show file tree
Hide file tree
Showing 7 changed files with 224 additions and 927 deletions.
20 changes: 1 addition & 19 deletions ember-cli-build.js
@@ -1,10 +1,6 @@
'use strict';

const EmberAddon = require('ember-cli/lib/broccoli/ember-addon');
const Funnel = require('broccoli-funnel');
const path = require('path');

const HAS_EMBER_SOURCE = 'ember-source' in require('./package.json').devDependencies;

module.exports = function(defaults) {
let app = new EmberAddon(defaults, {
Expand Down Expand Up @@ -37,19 +33,5 @@ module.exports = function(defaults) {
}
});

if (app.env === 'test') {
app.import(`${HAS_EMBER_SOURCE ? 'vendor' : 'bower_components'}/ember/ember-template-compiler.js`);
}

let additionalTrees = [];

if (HAS_EMBER_SOURCE) {
additionalTrees.push(new Funnel(path.dirname(require.resolve('ember-source/package.json')), {
srcDir: 'dist',
destDir: 'vendor/ember',
include: ['ember-template-compiler.js']
}));
}

return app.toTree(additionalTrees);
return app.toTree();
};
9 changes: 6 additions & 3 deletions package.json
Expand Up @@ -25,9 +25,9 @@
},
"homepage": "https://github.com/salsify/ember-css-modules#readme",
"devDependencies": {
"broccoli-rollup": "^2.1.1",
"console-ui": "^2.2.2",
"ember-ajax": "^3.0.0",
"ember-browserify": "^1.2.1",
"ember-cli": "^3.0.0",
"ember-cli-addon-tests": "^0.11.0",
"ember-cli-dependency-checker": "^2.1.0",
Expand Down Expand Up @@ -55,6 +55,8 @@
"loader.js": "^4.6.0",
"postcss-color-rebeccapurple": "^3.0.0",
"qunitjs": "^2.4.1",
"rollup-plugin-commonjs": "^9.1.3",
"rollup-plugin-node-resolve": "^3.3.0",
"sinon": "^4.3.0"
},
"keywords": [
Expand Down Expand Up @@ -91,9 +93,10 @@
"ember-cli-postcss"
],
"paths": [
"tests/dummy/lib/template-stuff",
"tests/dummy-addon",
"tests/dummy-sass-addon",
"tests/dummy-less-addon"
"tests/dummy-less-addon",
"tests/dummy-sass-addon"
]
}
}
2 changes: 0 additions & 2 deletions tests/dummy/app/app.js
Expand Up @@ -3,8 +3,6 @@ import Resolver from './resolver';
import loadInitializers from 'ember-load-initializers';
import config from './config/environment';

import 'npm:../../lib/htmlbars-plugin';

const App = Application.extend({
modulePrefix: config.modulePrefix,
podModulePrefix: config.podModulePrefix,
Expand Down
42 changes: 42 additions & 0 deletions tests/dummy/lib/template-stuff/index.js
@@ -0,0 +1,42 @@
/* eslint-env node */
/* eslint node/no-extraneous-require:off */
'use strict';

const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const Rollup = require('broccoli-rollup');

module.exports = {
name: 'template-stuff',

isDevelopingAddon() {
return true;
},

included() {
this._super.included.apply(this, arguments);

if (EmberApp.env() === 'test') {
this.import('node_modules/ember-source/dist/ember-template-compiler.js');
this.import('vendor/ecm-template-transform.js', {
using: [{ transformation: 'amd', as: 'ecm-template-transform' }]
});
}
},

treeForVendor() {
return new Rollup(`${__dirname}/../../../../lib`, {
rollup: {
input: 'htmlbars-plugin/index.js',
plugins: [
require('rollup-plugin-commonjs')(),
require('rollup-plugin-node-resolve')()
],
output: {
file: 'ecm-template-transform.js',
format: 'umd',
name: 'ecm-template-transform'
}
}
});
}
};
6 changes: 6 additions & 0 deletions tests/dummy/lib/template-stuff/package.json
@@ -0,0 +1,6 @@
{
"name": "template-stuff",
"keywords": [
"ember-addon"
]
}
2 changes: 1 addition & 1 deletion tests/helpers/render-with-styles.js
Expand Up @@ -2,7 +2,7 @@

import Ember from 'ember';
import { VERSION } from '@ember/version';
import ClassTransformPlugin from 'npm:../../lib/htmlbars-plugin';
import ClassTransformPlugin from 'ecm-template-transform';
const { compile } = Ember.__loader.require('ember-template-compiler');

const TEST_STYLES = '-testing/styles';
Expand Down

0 comments on commit e779359

Please sign in to comment.