spec: import asset as txt file, for bundlers
This commit is contained in:
4
assets/assets.d.ts
vendored
Normal file
4
assets/assets.d.ts
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
declare module '*.cfg' {
|
||||
const content: string;
|
||||
export default content;
|
||||
}
|
||||
@@ -30,6 +30,7 @@ async function buildFile(entryFile) {
|
||||
'--platform=node',
|
||||
'--format=esm',
|
||||
'--minify',
|
||||
'--loader:.cfg=text',
|
||||
'--outfile=' + outputFile,
|
||||
];
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import { Readable, Writable } from 'stream';
|
||||
import { createInterface } from 'readline';
|
||||
import { projectRoot } from '../environment/index.js';
|
||||
import { SPECBenchData, benchpath, exepath, buildpath } from './benchData.js';
|
||||
import specTemplate from '../../assets/specTemplate.cfg';
|
||||
|
||||
|
||||
|
||||
@@ -56,8 +57,6 @@ export function mkBench(spec: SPEC, bench: SPECBenchData): Bench {
|
||||
};
|
||||
}
|
||||
|
||||
const specTemplate = fs.readFileSync(path.resolve(projectRoot, "assets", "specTemplate.cfg")).toString("utf-8");
|
||||
|
||||
const writeFile = promisify(fs.writeFile);
|
||||
|
||||
export interface ConfigOptions {
|
||||
|
||||
Reference in New Issue
Block a user