yurynix-aot-loader
v0.0.2
Published
Load and Pre-evaluate code at build-time
Downloads
18
Readme
A fork of aot-loader
This is a fork of aot-loader
The difference is that you can return whatever you want from getData
:
rules: [
{
test: /modules\/module-list.ts/,
use: [
{
loader: 'aot-loader',
options: {
getData: (exported, context) => {
const requires = exported.map(mod => `require('${mod}')`).join(',\n');
const str = `export default [ ${requires} ];`;
return str;
}
}
},
{
loader: 'ts-loader',
options: {
happyPackMode: true,
compilerOptions: {
transpileOnly: true,
},
},
},
],
},
....
]
Another feautre is the sourcePreProcess
function that executed on the the source before calling getData
.