Skip to content

Instantly share code, notes, and snippets.

@DylanPiercey
Last active February 2, 2020 17:58
Show Gist options
  • Save DylanPiercey/8c26f2859a3c7d9ddb69f1af12e5b089 to your computer and use it in GitHub Desktop.
Save DylanPiercey/8c26f2859a3c7d9ddb69f1af12e5b089 to your computer and use it in GitHub Desktop.
Options for the Marko Rollup server side plugin
import marko from "@marko/rollup";
const commonPlugins = [...];
export default {
input: "src/index.js",
plugins: [
marko.server({
browser: {
// before passing to rollup would add the Marko plugin in hydrate mode.
plugins: [
...commonPlugins
]
}
}),
...commonPlugins
]
};
import marko from "@marko/rollup";
const commonPlugins = [...];
export default {
input: "src/index.js",
plugins: [
marko.server({
browser: {
plugins: [
marko.browser({ hydrate: true }),
...commonPlugins
]
}
}),
...commonPlugins
]
};
import marko from "@marko/rollup";
const commonPlugins = [...];
export default {
input: "src/index.js",
plugins: [
marko({
output: "html",
// the below option is a rollup confg for the browser builds
// it would automatically set the `input` option, but could maybe infer more
// options from the server config?
browser: {
plugins: [
// dom could be the default output type and so could ommitted below.
marko({ output: "dom", hydrate: true }),
...commonPlugins
]
}
}),
...commonPlugins
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment