MINA single-file-component loader for Webpack
npm install @tinajs/mina-loader> MINA single-file-component loader for Webpack.




_Inspired by zezhipeng/mina-loader._
``bash`
npm i --save-dev @tinajs/mina-loader webpack@^4.0.0
Note you'll have to use webpack 4.
`javascript`
/**
* webpack.config.js
*/
module.exports = {
context: resolve('src'),
mode: 'production',
entry: {
'app.mina': './app.mina',
'pages/home.mina': './pages/home.mina',
},
output: {
path: resolve('dist'),
filename: '[name]',
publicPath: '/',
},
module: {
rules: [
{
test: /\.mina$/,
use: {
loader: '@tinajs/mina-loader',
/**
* see Options
*/
options: {
loaders: {
script: 'babel-loader',
style: {
loader: 'postcss-loader',
options: {
config: {
path: resolve('./postcss.config.js'),
},
},
},
},
languages: {
less: 'less-loader',
},
},
},
},
],
},
}
For the best particle, you might also be interested in mina-webpack.
| Name | Default | Description |
| ------------------- | ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| loaders | { config: '', template: '', script: '', style: '' } | A map of _Rules.use_. See Webpack - Module - Rule.use for details. |''
| loaders.config | | The _Rules.use_ for . |''
| loaders.template | | The _Rules.use_ for |''
| loaders.script | | The _Rules.use_ for