Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions .core/gulp.tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -486,12 +486,15 @@ const reactium = (gulp, config, webpackConfig) => {

const pluginAssetsTemplate = data => {
const template = handlebars.compile(`
@use "sass:map";

$assets: () !default;

// Generated Data URLs from plugin-assets.json
$assets: (
{{#each this}}
'{{key}}': '{{{dataURL}}}',
{{/each}}
);`);
{{#each this}}
$assets: map.set($assets, "{{key}}", "{{{dataURL}}}");
{{/each}}
`);

return template(data);
};
Expand All @@ -501,7 +504,6 @@ $assets: (
for (const file of files) {
const manifest = path.resolve(file);
const base = path.dirname(manifest);

try {
let assets = fs.readFileSync(manifest);
assets = JSON.parse(assets);
Expand All @@ -510,6 +512,15 @@ $assets: (
const mappings = [];
for (const entry of entries) {
const [key, fileName] = entry;
console.log(
`Adding ${key}: ${path.resolve(
base,
fileName,
)} to partial at ${path.resolve(
base,
'_plugin-assets.scss',
)}`,
);
const dataURL = await fileReader(
new File(path.resolve(base, fileName)),
);
Expand Down