0.0.5 • Published 5 years ago

@lucashc/mini-program-loader v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

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

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

6 years ago

0.0.0

6 years ago