Registry / devops / rollup-plugin-marko

rollup-plugin-marko

JSON →
library0.0.2jsnpmunverified

Rollup plugin to compile Marko templates into JavaScript. Current version 0.0.2 is a proof of concept and not production-ready. It transforms .marko files and .marko.js files, but lacks proper source maps, async job handling, and tests. It requires the global `process` object to be polyfilled. This plugin is early-stage and should not be used in production. There are no recent updates or active development signs.

npm install rollup-plugin-marko
INSTALL
IMPORT
SIG · ROLLUP-PLUGIN-MARK
R
rollup-plugin-marko
devopsjavascriptv0.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

marko
import marko from 'rollup-plugin-marko'
const marko = require('rollup-plugin-marko')
ESM only; the plugin is a default export.
marko (as a function)
import marko from 'rollup-plugin-marko' export default { plugins: [marko()] }
export default { plugins: [marko] }
marko must be called as a function (even without options) because it returns a plugin object.
process polyfill
// In rollup config: import nodeGlobals from 'rollup-plugin-node-globals' ...plugins: [marko(), nodeGlobals()]
// Forgetting to add nodeGlobals plugin, causing runtime errors
Marko requires the global `process` object. The simplest way is to include rollup-plugin-node-globals.

Basic Rollup configuration using rollup-plugin-marko to compile Marko templates, including necessary companion plugins.

// Install the plugin and its dependencies // npm install rollup-plugin-marko rollup-plugin-babel rollup-plugin-commonjs rollup-plugin-node-resolve rollup-plugin-node-globals // rollup.config.js import babel from 'rollup-plugin-babel'; import commonjs from 'rollup-plugin-commonjs'; import nodeResolve from 'rollup-plugin-node-resolve'; import nodeGlobals from 'rollup-plugin-node-globals'; import marko from 'rollup-plugin-marko'; export default { input: 'src/app.js', output: { file: 'dist/bundle.js', format: 'iife', sourceMap: true }, plugins: [ marko(), babel({ exclude: 'node_modules/**' }), nodeResolve({ jsnext: true, main: true, browser: true, preferBuiltins: false }), commonjs({ include: ['node_modules/**', 'src/**/*.marko', 'src/**/*.marko.js'], extensions: ['.js', '.marko'], sourceMap: true }), nodeGlobals() ] };
Debug
Known issues
breakingRequires global `process` object polyfill. Without it, Marko templates will throw at runtime.
fix
Include rollup-plugin-node-globals or manually define `window.process` as shown in README.
affects: *
breakingVersion 0.0.2 is a proof of concept and lacks tests, source maps, and async job handling. Not recommended for production use.
fix
Do not use in production. Consider alternative bundlers or wait for a stable release.
affects: 0.0.2
gotchaThe plugin must be called as a function (e.g., `marko()`) in the plugins array, not referenced directly.
fix
Ensure usage is `marko()` not `marko`.
affects: *
Errors
Common errors & fixes
Uncaught ReferenceError: process is not defined
Marko templates require the `process` global, which is not available in browser bundles.
fix
Add rollup-plugin-node-globals or a polyfill for process.
Error: Cannot find module 'marko' from '...'
Missing Marko or its dependencies in node_modules.
fix
Run `npm install marko` to install Marko as a dependency.
TypeError: marko is not a function
The plugin was imported but not called as a function in the plugins array.
fix
Change `plugins: [marko]` to `plugins: [marko()]`.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
rollup-plugin-node-globalsrequiredRequired to polyfill Node.js globals like process for Marko
rollup-plugin-commonjsrequiredNeeded to convert CommonJS modules used by Marko
rollup-plugin-node-resolverequiredResolves node_modules for Marko dependencies
rollup-plugin-babelrequiredTranspile ES2015+ code in Marko templates
Agent activity
4 hits · last 30 days
node
4
Resources
rollup-plugin-marko — npm install rollup-plugin-marko · libregistry