0.0.2 • Published 5 years ago

yurynix-aot-loader v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

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.