npm i --save-dev @tinajs/wxs-loader
/**
* webpack.config.js
*/
module.exports = {
context: resolve('src'),
mode: 'production',
entry: {
'app.mina': './app.mina',
},
output: {
path: resolve('dist'),
filename: '[name]',
publicPath: '/',
},
module: {
rules: [
{
test: /\.mina$/,
use: {
loader: '@tinajs/mina-loader',
},
},
{
test: /\.wxs$/,
use: [
{
loader: '@tinajs/wxs-loader',
options: {
name: 'wxs/[name].[hash:6].[ext]',
},
},
],
},
],
},
}
For the best particle, you might also be interested in mina-webpack.
Name | Default | Description |
---|---|---|
name | [hash].[ext] |
Custom filename template, same as file-loader - name |
context | context |
Same as file-loader - context |
regExp | undefined |
Same as file-loader - regExp |
Apache-2.0 © yelo, 2018 - present