@tinajs/mina-runtime-webpack-plugin
TypeScript icon, indicating that this package has built-in type declarations

1.3.7 • Public • Published

mina-runtime-webpack-plugin

A runtime patch for compiling mina project by Webpack.

npm npm license PRs Welcome

Heavily inspired by and forked from Cap32/wxapp-webpack-plugin.

Installation

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

Usage

/**
 * 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.

Example

License

MIT © yelo, 2017 - present

Readme

Keywords

none

Package Sidebar

Install

npm i @tinajs/mina-runtime-webpack-plugin

Weekly Downloads

11

Version

1.3.7

License

MIT

Unpacked Size

13.7 kB

Total Files

11

Last publish

Collaborators

  • malash
  • jimexist
  • yelo