@lucashc/mini-program-loader
v0.0.5
Published
mini program loader for webpack
Downloads
2
Readme
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 sourcesenforceRelativePath
(Boolean): Should be true if you wish to generate aroot
relative URL for each file. It is recommend to set totrue
publicPath
(String): Defaults to webpack output.publicPathtransformContent(content, resource)
(Function): Transform content, should return a content stringtransformUrl(url, resource)
(Function): Transform url, should return a urlminimize
(Boolean): To minimize. Defaults tofalse
- All html-minifier options are supported
License
MIT