Skip to content

Commit

Permalink
Merge pull request #96 from loftwah/dl/font-awesome-broken
Browse files Browse the repository at this point in the history
Dl/font awesome broken
  • Loading branch information
loftwah authored Sep 3, 2024
2 parents a34794e + 15efa90 commit b609ba6
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//= link_tree ../images
//= link_directory ../stylesheets .css
//= link_directory ../stylesheets .scss
//= link_tree ../../javascript .js
//= link_tree ../../../vendor/javascript .js
//= link_tree ../builds
//= link application.css
1 change: 1 addition & 0 deletions app/assets/stylesheets/application.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "font-awesome";
1 change: 1 addition & 0 deletions app/javascript/entrypoints/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import "chartkick/chart.js";
import "flowbite";

import "../../assets/stylesheets/application.css";
import '../../assets/stylesheets/application.css.scss'
import "../../assets/stylesheets/application.tailwind.css";

Rails.start();
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<%= vite_client_tag %>
<%= vite_javascript_tag 'application' %>
<link rel="icon" href="/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />

<!-- Generic Open Graph Meta Tags (for general application pages) -->
<%= tag.meta property: 'og:type', content: 'website' %>
Expand Down
2 changes: 2 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class Application < Rails::Application

config.middleware.use PageViewTracker

# config.assets.paths << Rails.root.join("node_modules")

# Configuration for the application, engines, and railties goes here.
#
# These settings can be overridden in specific environments using the files
Expand Down
3 changes: 3 additions & 0 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
# application.js, application.css, and all non-JS/CSS in the app/assets
# folder are already added.
# Rails.application.config.assets.precompile += %w( admin.js admin.css )

Rails.application.config.assets.precompile += %w( *.scss )
Rails.application.config.assets.precompile += %w( application.css.scss )
2 changes: 1 addition & 1 deletion config/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
'./app/javascript/**/*.js',
'./app/views/**/*.{erb,haml,html,slim}',
'./node_modules/flowbite/**/*.js',
'./app/assets/stylesheets/**/*.css',
'./app/assets/stylesheets/**/*.{css,scss}',
],
theme: {
extend: {
Expand Down
11 changes: 6 additions & 5 deletions vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ export default defineConfig({
build: {
rollupOptions: {
input: {
application: 'app/javascript/entrypoints/application.js' // Path to your main JS entry point
application: 'app/javascript/entrypoints/application.js'
}
},
},
css: {
preprocessorOptions: {
scss: {
includePaths: [
path.resolve(__dirname, 'node_modules'), // Ensure Vite looks in node_modules for styles
path.resolve(__dirname, 'app/assets/stylesheets') // Include your stylesheets directory
path.resolve(__dirname, 'node_modules'),
path.resolve(__dirname, 'app/assets/stylesheets')
],
// Remove the additionalData line that was causing the circular import
},
},
},
assetsInclude: ['**/*.png', '**/*.jpg', '**/*.jpeg', '**/*.svg'] // Include any other assets you want to be processed
});
assetsInclude: ['**/*.png', '**/*.jpg', '**/*.jpeg', '**/*.svg', '**/*.eot', '**/*.ttf', '**/*.woff', '**/*.woff2']
});

0 comments on commit b609ba6

Please sign in to comment.