Skip to content

Instantly share code, notes, and snippets.

@zachleat
Last active March 21, 2020 02:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zachleat/8167227892251c4fa39653c639cd8939 to your computer and use it in GitHub Desktop.
Save zachleat/8167227892251c4fa39653c639cd8939 to your computer and use it in GitHub Desktop.
Eleventy + Vue Preview
const eleventyVue = require("@11ty/eleventy-plugin-vue");
module.exports = function(eleventyConfig) {
// Use Defaults
eleventyConfig.addPlugin(eleventyVue);
// OR, Use your own options
eleventyConfig.addPlugin(eleventyVue, {
// Directory for single file components (defaults to includes folder)
componentsDirectory: "",
// Directory to compile the Single File components into
cacheDirectory: ".cache/11ty/vue/",
// Example of using postcss in the single file components
rollupPluginVueOptions: {
style: {
postcssPlugins: [
require("autoprefixer"),
require("postcss-nested")
]
}
}
});
};
{
"dependencies": {
"@11ty/eleventy": "^0.11.0-beta.2",
"@11ty/eleventy-plugin-vue": "^0.0.2"
},
"scripts": {
"build": "ELEVENTY_EXPERIMENTAL=true eleventy"
}
}
@zachleat
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment