# @tinajs/mina-entry-webpack-plugin

> Automaticly generates entries-list from mina files for Webpack

Latest version **1.6.0** (published 2020-12-07) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @tinajs/mina-entry-webpack-plugin
pnpm add @tinajs/mina-entry-webpack-plugin
yarn add @tinajs/mina-entry-webpack-plugin
bun add @tinajs/mina-entry-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.6.0 |
| Published | 2020-12-07 |
| First published | 2017-11-28 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 15 |
| Unpacked size | 55.9 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 91 |
| Author | yelo |
| Maintainers | malash, jimexist, yelo |

## Links

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

## Dependencies (15)

- [json5](https://npm.io/package/json5.md) ^2.1.0
- [p-any](https://npm.io/package/p-any.md) ^2.1.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [flatten](https://npm.io/package/flatten.md) ^1.0.2
- [p-props](https://npm.io/package/p-props.md) ^1.2.0
- [resolve](https://npm.io/package/resolve.md) ^1.10.0
- [webpack](https://npm.io/package/webpack.md) ^4.39.2
- [fs-extra](https://npm.io/package/fs-extra.md) ^7.0.1
- [minimatch](https://npm.io/package/minimatch.md) ^3.0.4
- [replace-ext](https://npm.io/package/replace-ext.md) ^2.0.0
- [loader-utils](https://npm.io/package/loader-utils.md) ^1.2.3
- [resolve-from](https://npm.io/package/resolve-from.md) ^5.0.0
- [compose-function](https://npm.io/package/compose-function.md) ^3.0.3
- [ensure-posix-path](https://npm.io/package/ensure-posix-path.md) ^1.1.1
- [vue-template-compiler](https://npm.io/package/vue-template-compiler.md) ^2.6.7

## Recent versions

- 1.6.0 (latest) — 2020-12-07
- 1.5.3 — 2020-06-21
- 1.5.2 — 2020-06-09
- 1.5.1 — 2020-05-25
- 1.5.0 — 2020-03-16
- 1.4.6 — 2020-03-16
- 1.4.5 — 2020-03-16
- 1.4.4 — 2020-03-11
- 1.4.3 — 2020-01-21
- 1.4.2 — 2019-10-13
- 1.4.1 — 2019-09-29
- 1.4.0 — 2019-09-27
- 1.3.0 — 2019-08-15
- 1.2.0 — 2019-07-04
- 1.1.1 — 2019-05-08
- … 45 more at https://npm.io/package/@tinajs/mina-entry-webpack-plugin/versions

## README

# mina-entry-webpack-plugin

> Automaticly generates entries-list from mina files for [Webpack](https://webpack.js.org/)

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

## Installation

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

## Usage

```javascript
/**
 * webpack.config.js
 */
const webpack = require('webpack')
const MinaEntryPlugin = require('@tinajs/mina-entry-webpack-plugin')
const resolve = require('path').resolve

// implement yourself if necessary
const CustomFileTypeConfigReader = require('./custom-file-type-config-loader')

module.exports = {
  context: resolve('src'),
  entry: './app.mina',
  output: {
    path: resolve('dist'),
    filename: '[name]',
    publicPath: '/',
  },
  module: {
    rules: [
      {
        test: /\.mina$/,
        use: {
          loader: '@tinajs/mina-loader',
        },
      },
    ],
  },
  plugins: [
    new MinaEntryPlugin({
      map: (entry) => ['es6-promise/dist/es6-promise.auto.js', entry],
      rules: [{
        {
          pattern: '**/*.custom-file-type',
          reader: CustomFileTypeConfigReader,
        },
      }],
    }),
  ],
}
```

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

## Options

| Name                | Default                              | Description                                                                                                                                                  |
| ------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| map                 | (e) => e                             | Mapper function for each entry. Useful for adding polyfill scripts.                                                                                          |
| rules               | []                                   | Rules of custom config readers. See https://github.com/tinajs/mina-webpack/blob/master/packages/mina-loader/test/mina-entry-plugin.js#L204-L264 for examples |
| rules[].pattern     | ''                                   | [Pattern, using glob expressions](https://www.npmjs.com/package/minimatch)                                                                                   |
| rules[].reader      | ConfigReader                         | Custom config reader, should inherit from [ConfigReader](./lib/interfaces/config-reader.js) and implement its `getConfig` interface                          |
| extensions          | ...                                  | The extension names of each block for the separation (classical) files.                                                                                      |
| extensions.template | `['.wxml']`                          | The extension name of the `<template>` block                                                                                                                 |
| extensions.style    | `['.wxss']`                          | The extension name of the `<style>` block                                                                                                                    |
| extensions.script   | `['.js']`                            | The extension name of the `<script>` block                                                                                                                   |
| extensions.config   | `['.json']`                          | The extension name of the `<config>` block                                                                                                                   |
| extensions.resolve  | `['.js', '.wxml', '.json', '.wxss']` | The resolving order of extensions for the separation (classical) files.                                                                                      |
| minaLoaderOptions   | {}                                   | Options of `mina-loader` for classical components, usually you can just leave it by default.                                                                 |

## Example

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

## License

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

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