-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathember-cli-build.js
42 lines (35 loc) · 1.07 KB
/
ember-cli-build.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
'use strict';
const EmberApp = require('ember-cli/lib/broccoli/ember-app');
const postcssPlugins = require('narwin-pack');
const postcssFunctions = require('postcss-functions');
function pixelsToUnit(pixels, unit, context = '16px') {
return `${parseInt(pixels, 10) / parseInt(context, 10)}${unit}`;
}
const postcssUnitsFunctions = {
em: (pixels, context) => pixelsToUnit(pixels, 'em', context),
rem: (pixels, context) => pixelsToUnit(pixels, 'rem', context)
};
module.exports = function(defaults) {
let app = new EmberApp(defaults, {
// TODO: `ember-sortable` is the only reason why we still have to include jQuery.
// Uncomment as soon as you find an alternative to `ember-sortable`.
// vendorFiles: { 'jquery.js': null },
postcssOptions: {
compile: {
plugins: [
{ module: postcssPlugins },
{
module: postcssFunctions,
options: { functions: postcssUnitsFunctions }
}
]
}
},
stylelint: {
linterConfig: {
syntax: 'css'
}
}
});
return app.toTree();
};