Marko

Marko + Rollup

The @marko/rollup transform can be used in conjunction with rollup to automatically compile Marko templates that are required by other modules.

Manual Installation

npm install rollup rollup-plugin-commonjs rollup-plugin-node-resolve @marko/rollup --save-dev

Configuration

The following is the minimal recommend configuration to use Rollup with Marko:

rollup.config.js
import nodeResolve from "@rollup/plugin-node-resolve";
import commonjs from "@rollup/plugin-commonjs";
import marko from "@marko/rollup";

export default {
  ...,
  plugins: [
    marko(),
    nodeResolve({
      browser: true,
      extensions: [".js", ".marko"]
    }),
    // NOTE: Marko 4 compiles to commonjs, this plugin is also required.
    commonjs({
      extensions: [".js", ".marko"]
    }),
    // If using `style` blocks with Marko you must use an appropriate plugin.
    postcss({
      external: true
    })
  ]
};

Usage

# Development:
rollup -c rollup.config.js

# Production:
NODE_ENV=production rollup -c rollup.config.js
EDIT

Contributors

Helpful? You can thank these awesome people! You can also edit this doc if you see any issues or want to improve it.

Chat in Marko's Discord Server