introduce SettingsProviders

This commit is contained in:
Artur
2023-03-10 22:14:19 +01:00
parent 7ad54e0e3b
commit c57d094fe8
30 changed files with 256 additions and 413 deletions

View File

@@ -7,7 +7,7 @@ function getConfig(mode, agent, entry) {
entry: entry,
target: 'node',
mode: mode,
devtool: mode == 'development' ? 'inline-source-map' : false,
devtool: mode === 'development' ? 'inline-source-map' : false,
module: {
rules: [{
test: /\.tsx?$/,
@@ -43,7 +43,10 @@ function getConfig(mode, agent, entry) {
replace: 'let pkg = { version: "1.2.3" };'
}]
}])
]
],
experiments: {
topLevelAwait: true
}
}
}
@@ -62,12 +65,12 @@ const entryPoints = [
module.exports = (env) => {
const task = env.task || 'compile';
const agent = env.agent || 'mock';
const mode = task == 'compile' ? 'development' : 'production';
const mode = task === 'compile' ? 'development' : 'production';
const entry = {};
entryPoints.forEach(key => {
const resource = task == 'compile' ? `src/tasks/${key}.ts` : `dist/${agent}/${key}/bundle.js`;
const resource = task === 'compile' ? `src/tasks/${key}.ts` : `dist/${agent}/${key}/bundle.js`;
entry[key] = path.resolve(__dirname, resource);
});
return getConfig(mode, agent, entry);
};
};