# @tarojs/taro-loader

> Taro runner use webpack loader

Latest version **4.2.1** (published 2026-07-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tarojs/taro-loader
pnpm add @tarojs/taro-loader
yarn add @tarojs/taro-loader
bun add @tarojs/taro-loader
```

## Health

**Score 60/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score; popular repo.

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

## Facts

| | |
|---|---|
| Version | 4.2.1 |
| Published | 2026-07-17 |
| First published | 2020-02-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 18 |
| Dependencies | 2 |
| Unpacked size | 55.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 37675 |
| Author | O2Team |
| Maintainers | yuche, xuanzebin, defaultlee, drchan, kyjo, qq592743779, advancedcat, baosiqing, zakary, liuzejia, vasily.cjj, hardenzheng2 |

## Links

- npm: https://www.npmjs.com/package/@tarojs/taro-loader
- Repository: https://github.com/NervJS/taro
- Homepage: https://github.com/NervJS/taro#readme
- Issues: https://github.com/NervJS/taro/issues
- npm.io page: https://npm.io/package/@tarojs/taro-loader

## Dependencies (2)

- [@tarojs/helper](https://npm.io/package/@tarojs/helper.md) 4.2.1
- [@tarojs/shared](https://npm.io/package/@tarojs/shared.md) 4.2.1

## Recent versions

- 4.2.1 (latest) — 2026-07-17
- 4.2.2-beta.5 (beta) — 2026-09-14
- 4.2.2-alpha.2 (alpha) — 2026-09-01
- 3.6.40 (v3-latest) — 2026-04-13
- 3.6.40-beta.1 (v3-beta) — 2026-03-25
- 4.0.9-alpha.8 (test) — 2025-05-14
- 4.0.7-canary.6 (canary) — 2024-11-12
- 4.0.2 (next) — 2024-07-16
- 3.6.15-theta.0 (theta) — 2024-05-06
- 3.6.24-nightly.10 (nightly) — 2024-02-28
- 3.0.29 (3.0) — 2021-03-09
- 0.0.0-experimental.2 (experimental) — 2020-04-27
- 4.2.2-beta.4 — 2026-09-08
- 4.2.2-beta.3 — 2026-09-08
- 4.2.2-beta.1 — 2026-09-02
- … 882 more at https://npm.io/package/@tarojs/taro-loader/versions

## README

# `@tarojs/taro-loader`

暴露给 `@tarojs/webpack5-runner` 使用的 Webpack loader，包含以下 `loader`:

## app

小程序专用。在小程序入口文件调用 `@tarojs/runtime` 的 `createReactApp`/`createVueApp` 方法创建一个小程序 `App` 构造函数接受的对象。

### options: 
* `framework`: 框架类型，`'react' | 'nerv' | 'vue' | 'vue3'`
* `prerender`: [预渲染配置](https://taro-docs.jd.com/taro/next/docs/prerender.html)

## page

小程序专用。在小程序页面文件调用 `@tarojs/runtime` 的 `createPageConfig` 方法创建一个小程序 `Page` 构造函数接受的对象。
### options: 
* `framework`: 框架类型，`'react' | 'vue3'`
* `name`: 页面路径

## page

小程序专用。在小程序页面文件调用 `@tarojs/runtime` 的 `createComponentConfig` 方法创建一个小程序 `Component` 构造函数接受的对象。

### options: 
* `framework`: 框架类型，`'react' | 'vue3'`
* `name`: 页面路径

## h5

H5 专用。在小程序入口文件调用 `@tarojs/router` 的 `createRouter` 方法创建兼容小程序生命周期和路由系统的应用。

### options: 
* `framework`: 框架类型，`'react' | 'vue3'`
* `config`: 应用配置，对应 app.config.js
* `pages：页面配置，对应` page.config.js
* `filename`: 文件名

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