-
-
Notifications
You must be signed in to change notification settings - Fork 86
/
index.js
54 lines (47 loc) · 1.1 KB
/
index.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
43
44
45
46
47
48
49
50
51
52
53
54
/* eslint-disable prettier/prettier */
'use strict';
const Funnel = require('broccoli-funnel');
const path = require('path');
const CssImport = require('postcss-import')
const PresetEnv = require('postcss-preset-env');
const plugins = [
{ module: CssImport },
{
module: PresetEnv,
options: {
stage: 3,
features: { 'nesting-rules': true },
}
}
];
module.exports = {
name: require('./package').name,
options: {
postcssOptions: {
compile: {
enabled: true,
plugins,
}
}
},
included: function(app) {
this._super.included.apply(this, arguments);
app.options = app.options || {};
app.options.postcssOptions = {
compile: {
enabled: true,
plugins,
}
}
},
treeForPublic: function() {
return new Funnel(path.join(this.root, 'public'));
},
contentFor: function(type) {
if (type === 'head') {
// preload the most common fonts for modern browsers
return `<link rel="preload" as="font" type="font/woff2" href="/fonts/Inter-roman.var.woff2?v=3.15" crossorigin>`;
}
return '';
},
};