clean up manifest step more
This commit is contained in:
parent
f8c68847ca
commit
bd843e5317
33
index.mjs
33
index.mjs
|
@ -129,28 +129,21 @@ export function buildConfig ({
|
||||||
},
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
{
|
||||||
|
// emit other assets
|
||||||
buildStart () {
|
buildStart () {
|
||||||
assets.forEach(absolutePath => {
|
assets.forEach(absolutePath => this.emitFile({
|
||||||
this.emitFile({
|
type: 'asset',
|
||||||
type: 'asset',
|
fileName: getOutputFilename(absolutePath),
|
||||||
fileName: getOutputFilename(absolutePath),
|
source: readFileSync(absolutePath),
|
||||||
source: readFileSync(absolutePath),
|
}));
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
load (id) {
|
|
||||||
if (id === manifestPath) {
|
|
||||||
// throwaway contents, replaced later
|
|
||||||
return 'debugger;';
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
renderChunk (code, chunk) {
|
|
||||||
if (chunk.facadeModuleId !== manifestPath) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return JSON.stringify(manifestContent, null, '\t');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// hacks to make sure the manifest is emitted as bare JSON
|
||||||
|
load: id => id === manifestPath ? 'debugger;' : null,
|
||||||
|
renderChunk: (_, chunk) =>
|
||||||
|
chunk.facadeModuleId === manifestPath
|
||||||
|
? JSON.stringify(manifestContent, null, '\t')
|
||||||
|
: null,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue