@anejs/mina-loader
MINA single-file-component loader for Webpack
Last updated 2 years ago by xierenhong .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @anejs/mina-loader 
SYNC missed versions from official npm registry.

mina-loader

fork mina-loader 换 wxml-loader 为修改后的 @anejs/wxml-loader MINA single-file-component loader for Webpack.

npm npm license PRs Welcome

Inspired by zezhipeng/mina-loader.

Installation

npm i --save-dev @tinajs/mina-loader

Usage

/**
 * webpack.config.js
 */
module.exports = {
  context: resolve('src'),
  entry: {
    'app.mina': './app.mina',
    'pages/home.mina': './pages/home.mina',
  },
  output: {
    path: resolve('dist'),
    filename: '[name]',
    publicPath: '/',
  },
  module: {
    rules: [
      {
        test: /\.mina$/,
        use: {
          loader: 'mina-loader',
          /**
           * see Options
           */
          options: {
            loaders: {
              script: 'babel-loader',
              style: {
                loader: 'postcss-loader',
                options: {
                  config: {
                    path: resolve('./postcss.config.js'),
                  },
                },
              },
            },
          },
        },
      },
    ],
  },
}

For the best particle, you might also be interested in mina-webpack.

Options

Name Default Description
loaders {} A map of Rules.use. See Webpack - Module - Rule.use for details.
loaders.config undefined The Rules.use for <config>.
loaders.template undefined The Rules.use for <template>
loaders.script undefined The Rules.use for <script>
loaders.style undefined The Rules.use for <style>
publicPath output.publicPath Useful for relative publicPath, see extract-loader - options

Example

License

Apache-2.0 © yelo, 2017 - present

Current Tags

  • 0.6.4                                ...           latest (2 years ago)

1 Versions

  • 0.6.4                                ...           2 years ago
Maintainers (2)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (16)
Dev Dependencies (11)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |