# yurynix-aot-loader

> Load and Pre-evaluate code at build-time

Latest version **0.0.2** (published 2019-11-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install yurynix-aot-loader
pnpm add yurynix-aot-loader
yarn add yurynix-aot-loader
bun add yurynix-aot-loader
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2019-11-18 |
| First published | 2019-11-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | yurynix |
| Maintainers | yurynix |

## Links

- npm: https://www.npmjs.com/package/yurynix-aot-loader
- Repository: https://github.com/yurynix/aot-loader
- Homepage: https://github.com/yurynix/aot-loader#readme
- Issues: https://github.com/yurynix/aot-loader/issues
- npm.io page: https://npm.io/package/yurynix-aot-loader

## Dependencies (2)

- [loader-utils](https://npm.io/package/loader-utils.md) ^1.1.0
- [require-from-string](https://npm.io/package/require-from-string.md) ^2.0.2

## Recent versions

- 0.0.2 (latest) — 2019-11-18
- 0.0.1 — 2019-11-14

## README

### A fork of aot-loader
This is a fork of [aot-loader](https://github.com/egoist/aot-loader)

The difference is that you can return whatever you want from `getData`:

```es6
			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`.

---
_Source: https://npm.io/package/yurynix-aot-loader · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
