-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathember-cli-build.js
50 lines (46 loc) · 1.09 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
43
44
45
46
47
48
49
50
'use strict';
const { GlimmerApp } = require('@glimmer/application-pipeline');
const { log } = require('broccoli-stew');
const commonjs = require('rollup-plugin-commonjs');
const Funnel = require('broccoli-funnel');
const merge = require('broccoli-merge-trees');
const replace = require('broccoli-string-replace');
module.exports = function(defaults) {
const app = new GlimmerApp(defaults, {
'ember-cli-uglify': {
uglify: {
mangle: {
safari10: true,
},
},
},
fingerprint: {
assetMapPath: './asset-map.json',
generateAssetMap: true,
replaceExtensions: ['html', 'css', 'js', 'json'],
},
rollup: {
plugins: [
commonjs(),
],
},
});
const workers = replace(
new Funnel('workers', {
srcDir: '/',
destDir: '/',
include: ['**/*.js'],
}),
{
files: ['sw.js'],
pattern: {
match: /<@VERSION@>/g,
replacement: require('./package.json').version,
},
}
);
return log(merge([app.toTree(), workers]), {
output: 'tree',
label: 'app-tree',
});
};