# @tinajs/mina-runtime-webpack-plugin

> A runtime patch for compiling mina project by Webpack

Latest version **1.3.7** (published 2020-12-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @tinajs/mina-runtime-webpack-plugin
pnpm add @tinajs/mina-runtime-webpack-plugin
yarn add @tinajs/mina-runtime-webpack-plugin
bun add @tinajs/mina-runtime-webpack-plugin
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.3.7 |
| Published | 2020-12-07 |
| First published | 2017-11-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 13.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 91 |
| Author | yelo |
| Maintainers | malash, jimexist, yelo |

## Links

- npm: https://www.npmjs.com/package/@tinajs/mina-runtime-webpack-plugin
- Repository: https://github.com/tinajs/mina-webpack
- Homepage: https://github.com/tinajs/mina-webpack/tree/master/packages/mina-runtime-webpack-plugin#readme
- Issues: https://github.com/tinajs/mina-webpack/issues
- npm.io page: https://npm.io/package/@tinajs/mina-runtime-webpack-plugin

## Dependencies (4)

- [debug](https://npm.io/package/debug.md) ^4.1.1
- [required-path](https://npm.io/package/required-path.md) ^1.0.1
- [webpack-sources](https://npm.io/package/webpack-sources.md) ^1.3.0
- [ensure-posix-path](https://npm.io/package/ensure-posix-path.md) ^1.1.1

## Recent versions

- 1.3.7 (latest) — 2020-12-07
- 1.3.6 — 2020-03-16
- 1.3.5 — 2020-03-16
- 1.3.4 — 2020-03-11
- 1.3.3 — 2019-10-13
- 1.3.2 — 2019-09-29
- 1.3.1 — 2019-09-27
- 1.3.0 — 2019-08-15
- 1.2.3 — 2019-07-04
- 1.2.1 — 2019-05-08
- 1.2.0 — 2019-03-01
- 1.1.0 — 2019-01-23
- 1.0.4 — 2018-12-21
- 1.0.3 — 2018-12-21
- 1.0.2 — 2018-11-28
- … 18 more at https://npm.io/package/@tinajs/mina-runtime-webpack-plugin/versions

## README

# mina-runtime-webpack-plugin

> A runtime patch for compiling mina project by [Webpack](https://webpack.js.org/).

[![npm](https://img.shields.io/npm/v/@tinajs/mina-runtime-webpack-plugin.svg?style=flat-square)](https://www.npmjs.com/package/@tinajs/mina-runtime-webpack-plugin)
[![npm](https://img.shields.io/npm/dw/@tinajs/mina-runtime-webpack-plugin.svg?style=flat-square)](https://www.npmjs.com/package/@tinajs/mina-runtime-webpack-plugin)
[![license](https://img.shields.io/npm/l/@tinajs/mina-runtime-webpack-plugin.svg?style=flat-square)](./LICENSE)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

_Heavily inspired by and forked from [Cap32/wxapp-webpack-plugin](https://github.com/Cap32/wxapp-webpack-plugin)._

## Installation

```bash
npm i --save-dev @tinajs/mina-runtime-webpack-plugin
```

## Usage

```javascript
/**
 * webpack.config.js
 */
const webpack = require('webpack')
const MinaRuntimePlugin = require('@tinajs/mina-runtime-webpack-plugin')

const resolve = require('path').resolve

module.exports = {
  context: resolve('src'),
  entry: {
    'app.mina': './app.mina',
    'pages/home.mina': './pages/home.mina',
  },
  output: {
    path: resolve('dist'),
    filename: '[name]',
    publicPath: '/',
    globalObject: 'wx',
  },
  module: {
    rules: [
      {
        test: /\.mina$/,
        use: {
          loader: '@tinajs/mina-loader',
        },
      },
    ],
  },
  plugins: [new MinaRuntimePlugin()],
  optimization: {
    splitChunks: {
      chunks: 'all',
      name: 'common.js',
      minChunks: 2,
      minSize: 0,
    },
    runtimeChunk: {
      name: 'runtime.js',
    },
  },
  mode: 'none',
}
```

For the best particle, you might also be interested in [mina-webpack](https://github.com/tinajs/mina-webpack/).

## Example

- [mina-webpack - Full Example](https://github.com/tinajs/mina-webpack/tree/master/example)
- [TinaJS - HackerNews Reader](https://github.com/tinajs/tina-hackernews)

## License

MIT &copy; [yelo](https://github.com/imyelo), 2017 - present

---
_Source: https://npm.io/package/@tinajs/mina-runtime-webpack-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
