@videinfra/static-website-builder 2.0.2 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.prettierrc +11 -11
- package/CHANGELOG.md +214 -210
- package/README.md +102 -102
- package/bin/builder.js +40 -40
- package/eslint.config.js +39 -39
- package/gulpfile.js +63 -63
- package/init/default/config/config.js +44 -44
- package/init/default/src/html/data/global.js +9 -9
- package/init/default/src/javascripts/_entries.js +14 -14
- package/init/index.js +63 -63
- package/init/test/.env +6 -6
- package/init/test/.env.local +3 -2
- package/init/test/config/config.js +71 -67
- package/init/test/src/html/404.twig +12 -12
- package/init/test/src/html/data/global.js +10 -10
- package/init/test/src/html/env.twig +21 -21
- package/init/test/src/html/layouts/base.twig +1 -1
- package/init/test/src/html/other.twig +9 -9
- package/init/test/src/html/preposition.twig +4 -4
- package/init/test/src/javascripts/_entries-alt.js +10 -10
- package/init/test/src/javascripts/_entries.js +19 -19
- package/init/test/src/javascripts/common.js +13 -13
- package/init/test/src/javascripts/main.js +8 -8
- package/init/test/src/javascripts/something.ts +9 -9
- package/init/test/src/stylesheets/autoprefixer-test.scss +3 -3
- package/init/test/src/stylesheets/env-test.scss +28 -28
- package/init/test/src/stylesheets/ignore-test.scss +4 -4
- package/init/test/src/stylesheets/nested-calc-test.scss +3 -3
- package/init/test/src/stylesheets/sub-folder/import-test.scss +2 -2
- package/lib/camelize-file-name.js +21 -21
- package/lib/generate-gulp-tasks.js +85 -85
- package/lib/get-config.js +203 -204
- package/lib/get-file-names.js +23 -23
- package/lib/get-path.js +102 -102
- package/lib/globs-helper.js +243 -243
- package/lib/gulp/dynamic-task.js +8 -8
- package/lib/gulp/resolve-dynamic-task.js +11 -11
- package/lib/gulp/task-before-dest.js +8 -8
- package/lib/gulp/task-end.js +10 -10
- package/lib/gulp/task-start.js +12 -12
- package/lib/gulp/task-watch.js +66 -66
- package/lib/init/copy-folder.js +50 -50
- package/lib/init/folder-exists.js +10 -10
- package/lib/init/get-folder-list.js +16 -16
- package/lib/init/merge-package.js +17 -17
- package/lib/init/read-package.js +17 -17
- package/lib/log-error.js +15 -15
- package/lib/merge.js +27 -27
- package/lib/run-preprocess.js +32 -32
- package/lib/task-order.js +19 -19
- package/package.json +68 -68
- package/plugins/example/preprocess-config.js +17 -17
- package/plugins/example/task.js +55 -55
- package/plugins/example.js +38 -38
- package/plugins/sass-engine/preprocess-config.js +59 -59
- package/plugins/sass.js +41 -41
- package/plugins/twig/lodash-filters/filters.js +91 -91
- package/plugins/twig/lodash-filters.js +14 -14
- package/plugins/twig/symfony-filters/filters.js +102 -102
- package/plugins/twig/symfony-filters/preposition_nbsp.js +77 -77
- package/plugins/twig/symfony-filters.js +14 -14
- package/plugins/twig/symfony-functions/functions.js +31 -31
- package/plugins/twig/symfony-functions.js +14 -14
- package/plugins/twig-engine/preprocess-config.js +53 -53
- package/plugins/twig.js +74 -74
- package/tasks/browser-sync/config.js +39 -39
- package/tasks/browser-sync/preprocess-config.js +32 -32
- package/tasks/browser-sync/task.js +9 -9
- package/tasks/clean/config.js +20 -20
- package/tasks/clean/preprocess-config.js +19 -19
- package/tasks/clean/task.js +7 -7
- package/tasks/data/config.js +34 -34
- package/tasks/data/data-loader-js.js +14 -14
- package/tasks/data/data-loader-json.js +5 -5
- package/tasks/data/get-data.js +96 -96
- package/tasks/env/config.js +26 -23
- package/tasks/env/get-env.js +113 -81
- package/tasks/fonts/config.js +24 -24
- package/tasks/fonts/task.js +47 -47
- package/tasks/global/config.js +7 -7
- package/tasks/html/config.js +42 -42
- package/tasks/html/task.js +91 -91
- package/tasks/icons/config.js +47 -47
- package/tasks/icons/preprocess-config.js +60 -60
- package/tasks/icons/task.js +56 -56
- package/tasks/images/config.js +27 -27
- package/tasks/images/task.js +46 -46
- package/tasks/javascripts/config.js +69 -69
- package/tasks/javascripts/preprocess-config.js +109 -109
- package/tasks/javascripts/task.js +86 -86
- package/tasks/sitemap/config.js +48 -48
- package/tasks/sitemap/preprocess-config.js +18 -18
- package/tasks/sitemap/task.js +69 -69
- package/tasks/sizereport/config.js +23 -23
- package/tasks/sizereport/task.js +16 -16
- package/tasks/static/config.js +27 -27
- package/tasks/static/task.js +46 -46
- package/tasks/stylesheets/config.js +85 -85
- package/tasks/stylesheets/preprocess-config.js +41 -41
- package/tasks/stylesheets/task.js +73 -73
- package/tests/build/build.test.js +153 -153
- package/tests/camelize-file-name.test.js +11 -11
- package/tests/generate-gulp-tasks.test.js +78 -78
- package/tests/glob-helper.test.js +99 -99
- package/tests/merge.test.js +10 -10
- package/tests/preposition_nbsp.test.js +50 -50
- package/tests/run-preprocess.test.js +90 -90
- package/tests/sass-stringify.test.js +24 -24
- package/tests/sitemap.test.js +12 -12
- package/vendor/gulp-rolldown/index.js +151 -151
- package/vendor/gulp-rolldown/plugin-raw.js +17 -17
- package/vendor/gulp-rolldown/plugin-virtual-entry.js +30 -30
- package/vendor/gulp-sass/CHANGELOG.md +168 -168
- package/vendor/gulp-sass/LICENSE +20 -20
- package/vendor/gulp-sass/README.md +187 -187
- package/vendor/gulp-sass/index.js +208 -208
- package/vendor/gulp-sass/package.json +61 -61
- package/vendor/gulp-sass/sass-stringify.js +32 -32
- package/vendor/gulp-twig/LICENSE +20 -20
- package/vendor/gulp-twig/README.md +167 -167
- package/vendor/gulp-twig/index.js +138 -138
- package/vendor/gulp-twig/package.json +44 -44
|
@@ -1,151 +1,151 @@
|
|
|
1
|
-
import { Transform } from 'stream';
|
|
2
|
-
import PluginError from 'plugin-error';
|
|
3
|
-
|
|
4
|
-
import { watch, build } from 'rolldown';
|
|
5
|
-
import browserSync from 'browser-sync';
|
|
6
|
-
|
|
7
|
-
import virtualEntryPlugin from './plugin-virtual-entry.js';
|
|
8
|
-
import rawPlugin from './plugin-raw.js';
|
|
9
|
-
|
|
10
|
-
const PLUGIN_NAME = 'gulp-starter-rolldown';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Evaluate entry file
|
|
14
|
-
*
|
|
15
|
-
* @param {string} code Entry file code
|
|
16
|
-
* @returns {object} Entry file object
|
|
17
|
-
*/
|
|
18
|
-
function evalEntry(code) {
|
|
19
|
-
const fullCode = `let _return = {};
|
|
20
|
-
${code.replace(/\bexport\b[\s\t\r\n]*([^\s\t]+)/g, '_return.$1 =')}
|
|
21
|
-
return _return;`;
|
|
22
|
-
|
|
23
|
-
const result = new Function(fullCode)();
|
|
24
|
-
if (result.default) {
|
|
25
|
-
Object.assign(result, result.default);
|
|
26
|
-
delete result.default;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
return result;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const watcherList = {};
|
|
33
|
-
|
|
34
|
-
// transformer class
|
|
35
|
-
class GulpRolldown extends Transform {
|
|
36
|
-
_build(file, cb, inputOptions, outputOptions) {
|
|
37
|
-
build(inputOptions)
|
|
38
|
-
.then((result) => {
|
|
39
|
-
// Prevent gulp from outputing anything
|
|
40
|
-
cb();
|
|
41
|
-
})
|
|
42
|
-
.catch((err) => {
|
|
43
|
-
process.nextTick(() => {
|
|
44
|
-
this.emit('error', new PluginError(PLUGIN_NAME, err));
|
|
45
|
-
cb();
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
_watch(file, cb, inputOptions, outputOptions) {
|
|
51
|
-
const watcher = (watcherList[file.path] = watch(inputOptions));
|
|
52
|
-
|
|
53
|
-
watcher.on('event', (event) => {
|
|
54
|
-
if (event.code === 'BUNDLE_END') {
|
|
55
|
-
event.result.close();
|
|
56
|
-
|
|
57
|
-
// Reload browser
|
|
58
|
-
browserSync.reload();
|
|
59
|
-
} else if (event.code === 'ERROR') {
|
|
60
|
-
this.emit('error', new PluginError(PLUGIN_NAME, event.error));
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
// Prevent gulp from outputing anything
|
|
65
|
-
cb();
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
_transform(file, encoding, cb) {
|
|
69
|
-
// Empty or unavailable files, not supported
|
|
70
|
-
if (file.isNull()) {
|
|
71
|
-
return cb(null, file);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Stream, not supported
|
|
75
|
-
if (file.isStream()) {
|
|
76
|
-
return cb(new PluginError(PLUGIN_NAME, 'Streaming not supported'));
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
const entries = this.inputOptions.entries;
|
|
80
|
-
|
|
81
|
-
if (!file.path.endsWith(entries.name)) {
|
|
82
|
-
// Not an entry file, skip
|
|
83
|
-
return cb();
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Remove old watcher if exists
|
|
87
|
-
if (watcherList[file.path]) {
|
|
88
|
-
watcherList[file.path].close();
|
|
89
|
-
delete watcherList[file.path];
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Transform options
|
|
93
|
-
const inputOptions = Object.assign({}, this.inputOptions);
|
|
94
|
-
const outputOptions = Object.assign({}, this.outputOptions);
|
|
95
|
-
|
|
96
|
-
delete inputOptions.entries;
|
|
97
|
-
|
|
98
|
-
// Parse entry file
|
|
99
|
-
const entryContent = evalEntry(file.contents.toString());
|
|
100
|
-
|
|
101
|
-
// Add code splitting with shared
|
|
102
|
-
if (entries.shared) {
|
|
103
|
-
outputOptions.codeSplitting = Object.assign({}, outputOptions.codeSplitting || {}, {
|
|
104
|
-
groups: [].concat(outputOptions.codeSplitting?.groups || [], [
|
|
105
|
-
{
|
|
106
|
-
name: entries.shared,
|
|
107
|
-
minShareCount: 3,
|
|
108
|
-
},
|
|
109
|
-
]),
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// Don't output hash for rolldown runtime and shared chunks
|
|
114
|
-
outputOptions.chunkFileNames = (info) => {
|
|
115
|
-
if ((entries.shared && info.name === entries.shared) || info.name === 'rolldown-runtime') {
|
|
116
|
-
return '[name].js';
|
|
117
|
-
} else {
|
|
118
|
-
return '[name]-[hash].js';
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
// Set input files
|
|
123
|
-
inputOptions.input = Object.keys(entryContent);
|
|
124
|
-
inputOptions.plugins = [rawPlugin(), virtualEntryPlugin(entryContent)].concat(inputOptions.plugins || []);
|
|
125
|
-
|
|
126
|
-
// Set full paths when running watch or build
|
|
127
|
-
inputOptions.output = outputOptions;
|
|
128
|
-
|
|
129
|
-
if (global.production) {
|
|
130
|
-
this._build(file, cb, inputOptions);
|
|
131
|
-
} else {
|
|
132
|
-
this._watch(file, cb, inputOptions);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Factory
|
|
139
|
-
*
|
|
140
|
-
* @param {object} inputOptions
|
|
141
|
-
* @param {object} outputOptions
|
|
142
|
-
* @returns
|
|
143
|
-
*/
|
|
144
|
-
export default function factory(inputOptions, outputOptions) {
|
|
145
|
-
const stream = new GulpRolldown({ objectMode: true });
|
|
146
|
-
|
|
147
|
-
stream.inputOptions = inputOptions;
|
|
148
|
-
stream.outputOptions = outputOptions;
|
|
149
|
-
|
|
150
|
-
return stream;
|
|
151
|
-
}
|
|
1
|
+
import { Transform } from 'stream';
|
|
2
|
+
import PluginError from 'plugin-error';
|
|
3
|
+
|
|
4
|
+
import { watch, build } from 'rolldown';
|
|
5
|
+
import browserSync from 'browser-sync';
|
|
6
|
+
|
|
7
|
+
import virtualEntryPlugin from './plugin-virtual-entry.js';
|
|
8
|
+
import rawPlugin from './plugin-raw.js';
|
|
9
|
+
|
|
10
|
+
const PLUGIN_NAME = 'gulp-starter-rolldown';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Evaluate entry file
|
|
14
|
+
*
|
|
15
|
+
* @param {string} code Entry file code
|
|
16
|
+
* @returns {object} Entry file object
|
|
17
|
+
*/
|
|
18
|
+
function evalEntry(code) {
|
|
19
|
+
const fullCode = `let _return = {};
|
|
20
|
+
${code.replace(/\bexport\b[\s\t\r\n]*([^\s\t]+)/g, '_return.$1 =')}
|
|
21
|
+
return _return;`;
|
|
22
|
+
|
|
23
|
+
const result = new Function(fullCode)();
|
|
24
|
+
if (result.default) {
|
|
25
|
+
Object.assign(result, result.default);
|
|
26
|
+
delete result.default;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const watcherList = {};
|
|
33
|
+
|
|
34
|
+
// transformer class
|
|
35
|
+
class GulpRolldown extends Transform {
|
|
36
|
+
_build(file, cb, inputOptions, outputOptions) {
|
|
37
|
+
build(inputOptions)
|
|
38
|
+
.then((result) => {
|
|
39
|
+
// Prevent gulp from outputing anything
|
|
40
|
+
cb();
|
|
41
|
+
})
|
|
42
|
+
.catch((err) => {
|
|
43
|
+
process.nextTick(() => {
|
|
44
|
+
this.emit('error', new PluginError(PLUGIN_NAME, err));
|
|
45
|
+
cb();
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
_watch(file, cb, inputOptions, outputOptions) {
|
|
51
|
+
const watcher = (watcherList[file.path] = watch(inputOptions));
|
|
52
|
+
|
|
53
|
+
watcher.on('event', (event) => {
|
|
54
|
+
if (event.code === 'BUNDLE_END') {
|
|
55
|
+
event.result.close();
|
|
56
|
+
|
|
57
|
+
// Reload browser
|
|
58
|
+
browserSync.reload();
|
|
59
|
+
} else if (event.code === 'ERROR') {
|
|
60
|
+
this.emit('error', new PluginError(PLUGIN_NAME, event.error));
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
// Prevent gulp from outputing anything
|
|
65
|
+
cb();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
_transform(file, encoding, cb) {
|
|
69
|
+
// Empty or unavailable files, not supported
|
|
70
|
+
if (file.isNull()) {
|
|
71
|
+
return cb(null, file);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
// Stream, not supported
|
|
75
|
+
if (file.isStream()) {
|
|
76
|
+
return cb(new PluginError(PLUGIN_NAME, 'Streaming not supported'));
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const entries = this.inputOptions.entries;
|
|
80
|
+
|
|
81
|
+
if (!file.path.endsWith(entries.name)) {
|
|
82
|
+
// Not an entry file, skip
|
|
83
|
+
return cb();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Remove old watcher if exists
|
|
87
|
+
if (watcherList[file.path]) {
|
|
88
|
+
watcherList[file.path].close();
|
|
89
|
+
delete watcherList[file.path];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// Transform options
|
|
93
|
+
const inputOptions = Object.assign({}, this.inputOptions);
|
|
94
|
+
const outputOptions = Object.assign({}, this.outputOptions);
|
|
95
|
+
|
|
96
|
+
delete inputOptions.entries;
|
|
97
|
+
|
|
98
|
+
// Parse entry file
|
|
99
|
+
const entryContent = evalEntry(file.contents.toString());
|
|
100
|
+
|
|
101
|
+
// Add code splitting with shared
|
|
102
|
+
if (entries.shared) {
|
|
103
|
+
outputOptions.codeSplitting = Object.assign({}, outputOptions.codeSplitting || {}, {
|
|
104
|
+
groups: [].concat(outputOptions.codeSplitting?.groups || [], [
|
|
105
|
+
{
|
|
106
|
+
name: entries.shared,
|
|
107
|
+
minShareCount: 3,
|
|
108
|
+
},
|
|
109
|
+
]),
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Don't output hash for rolldown runtime and shared chunks
|
|
114
|
+
outputOptions.chunkFileNames = (info) => {
|
|
115
|
+
if ((entries.shared && info.name === entries.shared) || info.name === 'rolldown-runtime') {
|
|
116
|
+
return '[name].js';
|
|
117
|
+
} else {
|
|
118
|
+
return '[name]-[hash].js';
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
// Set input files
|
|
123
|
+
inputOptions.input = Object.keys(entryContent);
|
|
124
|
+
inputOptions.plugins = [rawPlugin(), virtualEntryPlugin(entryContent)].concat(inputOptions.plugins || []);
|
|
125
|
+
|
|
126
|
+
// Set full paths when running watch or build
|
|
127
|
+
inputOptions.output = outputOptions;
|
|
128
|
+
|
|
129
|
+
if (global.production) {
|
|
130
|
+
this._build(file, cb, inputOptions);
|
|
131
|
+
} else {
|
|
132
|
+
this._watch(file, cb, inputOptions);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Factory
|
|
139
|
+
*
|
|
140
|
+
* @param {object} inputOptions
|
|
141
|
+
* @param {object} outputOptions
|
|
142
|
+
* @returns
|
|
143
|
+
*/
|
|
144
|
+
export default function factory(inputOptions, outputOptions) {
|
|
145
|
+
const stream = new GulpRolldown({ objectMode: true });
|
|
146
|
+
|
|
147
|
+
stream.inputOptions = inputOptions;
|
|
148
|
+
stream.outputOptions = outputOptions;
|
|
149
|
+
|
|
150
|
+
return stream;
|
|
151
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
|
|
3
|
-
export default function rawPlugin() {
|
|
4
|
-
return {
|
|
5
|
-
name: 'raw',
|
|
6
|
-
load: {
|
|
7
|
-
filter: {
|
|
8
|
-
id: /\?raw$/,
|
|
9
|
-
},
|
|
10
|
-
handler(id) {
|
|
11
|
-
const content = fs.readFileSync(id.replace('?raw', '')).toString('utf-8');
|
|
12
|
-
return `export default \`${content.replace(/`/g, '\\`')}\``;
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
}
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
|
|
3
|
+
export default function rawPlugin() {
|
|
4
|
+
return {
|
|
5
|
+
name: 'raw',
|
|
6
|
+
load: {
|
|
7
|
+
filter: {
|
|
8
|
+
id: /\?raw$/,
|
|
9
|
+
},
|
|
10
|
+
handler(id) {
|
|
11
|
+
const content = fs.readFileSync(id.replace('?raw', '')).toString('utf-8');
|
|
12
|
+
return `export default \`${content.replace(/`/g, '\\`')}\``;
|
|
13
|
+
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Virtual entry plugin to generate files from each of the entries in the entry file
|
|
3
|
-
*
|
|
4
|
-
* @param {object} entries Entries object from the entry file
|
|
5
|
-
* @returns {object} Virtual entry plugin
|
|
6
|
-
*/
|
|
7
|
-
export default function virtualEntryPlugin(entries) {
|
|
8
|
-
const keys = Object.keys(entries);
|
|
9
|
-
|
|
10
|
-
return {
|
|
11
|
-
name: 'virtual-entry-plugin', // this name will show up in logs and errors
|
|
12
|
-
|
|
13
|
-
resolveId: {
|
|
14
|
-
order: 'post',
|
|
15
|
-
handler(source) {
|
|
16
|
-
if (keys.includes(source)) {
|
|
17
|
-
return source;
|
|
18
|
-
}
|
|
19
|
-
return null; // other ids should be handled as usual
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
load(id) {
|
|
24
|
-
if (keys.includes(id)) {
|
|
25
|
-
return entries[id].map((entry) => `import '${entry}';`).join('\n');
|
|
26
|
-
}
|
|
27
|
-
return null; // other ids should be handled as usual
|
|
28
|
-
},
|
|
29
|
-
};
|
|
30
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Virtual entry plugin to generate files from each of the entries in the entry file
|
|
3
|
+
*
|
|
4
|
+
* @param {object} entries Entries object from the entry file
|
|
5
|
+
* @returns {object} Virtual entry plugin
|
|
6
|
+
*/
|
|
7
|
+
export default function virtualEntryPlugin(entries) {
|
|
8
|
+
const keys = Object.keys(entries);
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
name: 'virtual-entry-plugin', // this name will show up in logs and errors
|
|
12
|
+
|
|
13
|
+
resolveId: {
|
|
14
|
+
order: 'post',
|
|
15
|
+
handler(source) {
|
|
16
|
+
if (keys.includes(source)) {
|
|
17
|
+
return source;
|
|
18
|
+
}
|
|
19
|
+
return null; // other ids should be handled as usual
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
load(id) {
|
|
24
|
+
if (keys.includes(id)) {
|
|
25
|
+
return entries[id].map((entry) => `import '${entry}';`).join('\n');
|
|
26
|
+
}
|
|
27
|
+
return null; // other ids should be handled as usual
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|