
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@tinajs/mina-loader
Advanced tools
MINA single-file-component loader for Webpack.
Inspired by zezhipeng/mina-loader.
npm i --save-dev @tinajs/mina-loader webpack@^4.0.0
Note you'll have to use webpack 4.
/**
* 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 <config> . |
loaders.template | '' | The Rules.use for <template> |
loaders.script | '' | The Rules.use for <script> |
loaders.style | '' | The Rules.use for <style> |
languages | {} | Used in the .mina file with the lang attribute. A map of Rules.use. See Webpack - Module - Rule.use for details. |
extensions | { config: '.json', template: '.wxml', style: '.wxss' } | The extension names of the emitted files |
extensions.config | '.json' | The extension name of the file emitted with the <config> block |
extensions.template | '.wxml' | The extension name of the file emitted with the <template> block |
extensions.style | '.wxss' | The extension name of the file emitted with the <style> block |
transform | (ast) => ast | Function used to transform mina AST before emitting files. Useful for translate mina into another language, such as Alipay Mini Programs or pure web pages |
publicPath | output.publicPath | Useful for relative publicPath , see extract-loader - options |
enforceRelativePath | true | The same option enforceRelativePath in wxml-loader, see wxml-loader - Usage. It is highly recommended to keep the default. |
Apache-2.0 © yelo, 2017 - present
FAQs
MINA single-file-component loader for Webpack
The npm package @tinajs/mina-loader receives a total of 82 weekly downloads. As such, @tinajs/mina-loader popularity was classified as not popular.
We found that @tinajs/mina-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.