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: [
{
buildStart () {
styles.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);
[...styles, ...assets].forEach(absolutePath => {
this.emitFile({
type: 'asset',
fileName: getOutputFilename(absolutePath),
@ -145,14 +137,13 @@ export function buildConfig ({
});
},
load (id) {
// console.log(id);
if (id === manifestPath) {
// throwaway contents, replaced later
return 'debugger;';
}
return null;
},
renderChunk (code, chunk) {
// console.log(chunk);
if (chunk.facadeModuleId !== manifestPath) {
return null;
}