clean up asset handling

This commit is contained in:
Erin 2023-07-28 05:18:57 -04:00
parent 03be5326ce
commit a1752fc9cd

View file

@ -128,15 +128,7 @@ export function buildConfig ({
plugins: [ plugins: [
{ {
buildStart () { buildStart () {
styles.forEach(absolutePath => { [...styles, ...assets].forEach(absolutePath => {
this.emitFile({
type: 'asset',
fileName: getOutputFilename(absolutePath, 'css'),
source: readFileSync(absolutePath, {encoding: 'utf-8'}),
});
});
assets.forEach(absolutePath => {
// console.log('rendering binary file', absolutePath);
this.emitFile({ this.emitFile({
type: 'asset', type: 'asset',
fileName: getOutputFilename(absolutePath), fileName: getOutputFilename(absolutePath),
@ -145,14 +137,13 @@ export function buildConfig ({
}); });
}, },
load (id) { load (id) {
// console.log(id);
if (id === manifestPath) { if (id === manifestPath) {
// throwaway contents, replaced later
return 'debugger;'; return 'debugger;';
} }
return null; return null;
}, },
renderChunk (code, chunk) { renderChunk (code, chunk) {
// console.log(chunk);
if (chunk.facadeModuleId !== manifestPath) { if (chunk.facadeModuleId !== manifestPath) {
return null; return null;
} }