1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | Object.defineProperty(exports, "__esModule", { value: true });
|
7 | const path_1 = require("path");
|
8 | const testsPattern = new RegExp(`^/?[^/]+/(tests|test-support)/`);
|
9 | class BundleConfig {
|
10 | constructor(emberApp) {
|
11 | this.emberApp = emberApp;
|
12 | }
|
13 |
|
14 |
|
15 | get names() {
|
16 | return Object.freeze(['app', 'tests']);
|
17 | }
|
18 | get types() {
|
19 | return Object.freeze(['js', 'css']);
|
20 | }
|
21 |
|
22 | bundleEntrypoint(name, type) {
|
23 | switch (name) {
|
24 | case 'tests':
|
25 | switch (type) {
|
26 | case 'js':
|
27 | return 'assets/test-support.js';
|
28 | case 'css':
|
29 | return 'assets/test-support.css';
|
30 | }
|
31 | case 'app':
|
32 | switch (type) {
|
33 | case 'js':
|
34 | return this.emberApp.options.outputPaths.vendor.js.replace(/^\//, '');
|
35 | case 'css':
|
36 | return this.emberApp.options.outputPaths.vendor.css.replace(/^\//, '');
|
37 | }
|
38 | }
|
39 | }
|
40 |
|
41 |
|
42 | bundleForPath(path) {
|
43 | if (testsPattern.test(path)) {
|
44 | return 'tests';
|
45 | }
|
46 | else {
|
47 | return 'app';
|
48 | }
|
49 | }
|
50 | get lazyChunkPath() {
|
51 | return path_1.dirname(this.bundleEntrypoint(this.names[0], 'js'));
|
52 | }
|
53 | }
|
54 | exports.default = BundleConfig;
|
55 |
|
\ | No newline at end of file |