Giter Site home page Giter Site logo

vite-plugin-liquid's Introduction

Logo

npm package node compatility

⚡⚙️ Vituum

Fast Prototyping with Template Engines in Vite

  • ⚡ Vite Plugins
  • 🚀️ Fast prototyping
  • 💡 Template Engines
  • ✉️ Email Templates

Small and fast static site generator for Vite.
It's a mix of words Vite (French word for "quick") and Tuum (Estonian word for "core").

Learn more about Vituum on Features page.

🪄 Get started

npm create vite@latest
npm i vituum --save-dev

Config

Read the Docs to learn more about configuration.

import vituum from 'vituum'

export default {
    plugins: [
        vituum()
    ]
}

You can try Vituum online on Stackblitz or view all examples on GitHub

Requirements

Licence

MIT

vite-plugin-liquid's People

Contributors

lubomirblazekcz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

johnnymcgee

vite-plugin-liquid's Issues

npm build does not use data from JSON files

When using the following file structure (based on the provided example in VItuum repo)

image

and running build npm script, the resulting HTML files are not build using any of the data present in the JSON files.

When running dev script, everything works fine

npm Build Cannot Find File

Currently I have .liquid files and using the layout tag for example:

{% layout "pages/layouts/base.liquid" %}

It works in development, but on build it fails with a message:

[vite:build-html] ENOENT: Failed to lookup "pages/layouts/base.liquid" in "./src", line:2, col:3

For it to work on build it required me to add the .html extension as such:

{% layout "pages/layouts/base.liquid.html" %}

But then this fails in development

Error [ERR_REQUIRE_ESM]

Hi there, I'm getting the following but can't see any explicit use of require() in my config:

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/brendon/Templates/vue3-templates/node_modules/@vituum/vite-plugin-liquid/index.js from /Users/brendon/Templates/vue3-templates/vite.config.js not supported.
Instead change the require of index.js in /Users/brendon/Templates/vue3-templates/vite.config.js to a dynamic import() which is available in all CommonJS modules.

Is this a problem with vite-plugin-liquid or something I'm doing wrong? This is a vue-create project.

import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import liquid from '@vituum/vite-plugin-liquid'


// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    vue(),
    liquid()
  ],
  root: `templates/${process.env.TEMPLATE}`,
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url))
    }
  },
  optimizeDeps: {
    disabled: false
  },
  build: {
    commonjsOptions: {
      include: []
    }
  }
})

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.