question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ruby on Rails Pug probems

See original GitHub issue

I’ve got couple of problems with Rails and Windi on Vite One are that tailwind.config.js / windi.config.js / windi.config.ts configs are not being loaded when running bin/vite de, only settings from vite.config.ts works.

Also I’ve got problem with pug, div.bg-white don’t work but div(class='bg-white') will work or

div {
  @apply bg-white;
}

also works, I can’t figure normal classes to work with pug, I did try setting in vite.config.ts scanning, nothing works.

My config

import { defineConfig } from "vite"
import RubyPlugin from "vite-plugin-ruby"
import WindiCSS from "vite-plugin-windicss"
import vue from "@vitejs/plugin-vue"

export default defineConfig({
  plugins: [
    WindiCSS({
      scan: {
        //////// this one helps but doesn't fix problem
        dirs: ["."], // all files in the cwd
        fileExtensions: ["vue", "js", "ts", "pug"], // also enabled scanning for js/ts
      },
    }),
    RubyPlugin(),
    vue(),
  ],
})

also got pug dev dependency installed

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ElMassimocommented, Jul 26, 2021

@xxSkyy Make sure to provide the root option to the Windi CSS plugin, as in these instructions.

0reactions
antfucommented, Jul 26, 2021

I am not familiar with ruby, but can you try this:

  extract: {
    include: ["**/*.{vue,html,jsx,tsx,pug}"],
    exclude: ["node_modules", ".git"],
  },

I guess the ruby plugin might change the vite’s root by somehow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SimpleDelegator autoloading issues with Rails
The problem​​ Both Rails (code) and SimpleDelegator (code) hook into const_missing . Rails does it for autoloading. Since the SimpleDelegator superclass is ...
Read more >
Rails with Jader gets 'failed to require "fs"' error - Stack Overflow
I am trying to use client side Jade templates that are precompiled by Ruby on Rails and available through JST. I added the...
Read more >
Pug vs Rails | What are the differences? - StackShare
Pug can be classified as a tool in the "Templating Languages & Extensions" category, while Rails is grouped under "Frameworks (Full Stack)". "Elegant...
Read more >
Using Jade (Pug) to preprocess HTML - Nikita Kazakov
I do use HAML with Ruby and Ruby on Rails and it is very similar. ... Jade Templating language, now known as Pug,...
Read more >
Which is fastest? ERB vs. HAML vs. Slim - Honeybadger.io
Ruby and the Rails gem are pretty much what we need to get started. For this tutorial, Visual Studio Code is the IDE...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found