rollup-plugin-jtaro-module
raw JSON → 0.3.2 verified Mon Apr 27 auth: no javascript maintenance
A Rollup plugin for JTaro Module that enables importing CSS, HTML templates, and processing them for Vue.js applications. Version 0.3.2 is the latest stable release, last updated in 2018. It provides features like HTML to Vue render function conversion, style merging, and source map support. Differentiators include simplified module bundling for JTaro-based projects, automatic CSS order management, and integration with Vue render functions.
Common errors
error Error: Cannot find module 'rollup-plugin-jtaro-module' ↓
cause Module not installed or not installed as devDependency.
fix
npm install --save-dev rollup-plugin-jtaro-module
error Error: Invalid hook: the plugin is not compatible with rollup >=2.0 ↓
cause Plugin uses Rollup v1 plugin API hooks that are deprecated in v2+.
fix
Use Rollup v1.x or update the plugin source code.
Warnings
deprecated Package has not been updated since 2018 and may be incompatible with newer Rollup versions (v2+). ↓
fix Consider migrating to a maintained alternative or adapting the plugin for Rollup v2+.
gotcha The html2Render option requires Vue.js, but the plugin does not explicitly depend on it. ↓
fix Ensure Vue is installed if using html2Render: true.
gotcha CSS imports may cause infinite loops in certain configurations (fixed in 0.3.2). ↓
fix Update to version 0.3.2 or later.
Install
npm install rollup-plugin-jtaro-module yarn add rollup-plugin-jtaro-module pnpm add rollup-plugin-jtaro-module Imports
- jtaroModule wrong
const jtaroModule = require('rollup-plugin-jtaro-module')correctimport jtaroModule from 'rollup-plugin-jtaro-module'
Quickstart
// rollup.config.js
import jtaroModule from 'rollup-plugin-jtaro-module'
export default {
input: 'src/index.js',
output: {
file: 'dist/bundle.js',
format: 'iife'
},
plugins: [
jtaroModule({
root: 'website',
html2Render: true
})
]
}
// src/index.js
import './reset.css';
import template from './template.html';
console.log(template);