# rollup-plugin-marko

> Marko transform/plugin for Rollup

Latest version **0.0.2** (published 2016-08-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install rollup-plugin-marko
pnpm add rollup-plugin-marko
yarn add rollup-plugin-marko
bun add rollup-plugin-marko
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2016-08-23 |
| First published | 2016-08-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Patrick Steele-Idem |
| Maintainers | lohfu |
| Keywords | rollup-plugin, marko |

## Links

- npm: https://www.npmjs.com/package/rollup-plugin-marko
- Repository: https://github.com/marko-js/markoify
- Homepage: https://github.com/marko-js/markoify#readme
- Issues: https://github.com/marko-js/markoify/issues
- npm.io page: https://npm.io/package/rollup-plugin-marko

## Dependencies (6)

- [marko](https://npm.io/package/marko.md) ^3.1.5
- [esprima](https://npm.io/package/esprima.md) ^2.7.2
- [through](https://npm.io/package/through.md) ^2.3.8
- [escodegen](https://npm.io/package/escodegen.md) ^1.8.0
- [estraverse](https://npm.io/package/estraverse.md) ^4.2.0
- [rollup-pluginutils](https://npm.io/package/rollup-pluginutils.md) ^1.5.1

## Alternatives

- [raw-loader](https://npm.io/package/raw-loader.md) — 4.3M weekly downloads
- [plop](https://npm.io/package/plop.md) — 1.4M weekly downloads
- [webpack-deadcode-plugin](https://npm.io/package/webpack-deadcode-plugin.md) — 80.3K weekly downloads
- [@storybook/preact-vite](https://npm.io/package/@storybook/preact-vite.md) — 54.2K weekly downloads
- [vite-plugin-transform](https://npm.io/package/vite-plugin-transform.md) — 2.4K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2016-08-23
- 0.0.1 — 2016-08-21
- 0.0.0 — 2016-08-18

## README

# rollup-plugin-marko

Compiles marko templates

## This is only a Proof of Concept!

WARNING!!! This is only a proof of concept, and is not yet fully tested.

## NPM

```
$ npm install rollup-plugin-marko
```

## Example

NOTE: You have to provide the `process` global for Marko to work outside of CommonJS
bundlers.

### process.js

```
window.process = {
  browser: true,
  env: {},
  nextTick: (fnc) => {
    setTimeout(fnc)
  }
}
```

### 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 {
  plugins: [
    marko(),
    babel({
      exclude: 'node_modules/**'
    }),
    nodeResolve({
      jsnext: true,  // Default: false
      main: true,  // Default: true
      browser: true,  // Default: false
      preferBuiltins: false
    }),

    commonjs({
      include: [ 'node_modules/**', 'src/**/*.marko', 'src/**/*.marko.js'],
      extensions: [ '.js', '.marko' ],
      sourceMap: true
    }),
  ],
  entry: 'src/app.js'
  sourceMap: true,
  format: 'iife'
}
```


## TODO

+ Implement source maps correctly (but they are probably not even needed as
  long as this plugin is loaded first)
+ Currently this plugin only transforms `marko.js`, and `.marko` files. Ie, if there
  are any require.resolve('./template.marko') in other js files they will not be fixed
+ Async jobs for compiled nested templates (required templates)
+ Tests

---
_Source: https://npm.io/package/rollup-plugin-marko · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
