@lucashc/mini-program-loader

0.0.5 • Public • Published

mini-program-loader

mini program loader for webpack, forked from wxapp-boilerplate, added support for Baidu smart app.

Installation

yarn add -D @lucashc/mini-program-loader

Usage

You may also need to use file-loader to extract files.

{
  test: /\.wxml$/,
  include: /src/,
  use: [
    {
      loader: 'file-loader',
      options: {
        name: '[name].[ext]',
        useRelativePath: true,
        context: resolve('src'),
      },
    },
    {
      loader: '@lucashc/mini-program-loader-loader',
      options: {
        root: resolve('src'),
        enforceRelativePath: true,
      },
    },
  ],
}
Options
  • root (String): Root path for requiring sources
  • enforceRelativePath (Boolean): Should be true if you wish to generate a root relative URL for each file. It is recommend to set to true
  • publicPath (String): Defaults to webpack output.publicPath
  • transformContent(content, resource) (Function): Transform content, should return a content string
  • transformUrl(url, resource) (Function): Transform url, should return a url
  • minimize (Boolean): To minimize. Defaults to false
  • All html-minifier options are supported

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i @lucashc/mini-program-loader

Weekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

13.1 kB

Total Files

4

Last publish

Collaborators

  • lucashc