[v5] - node ace build don't build css file #4553
-
Hi guys, I didn't change anything related to assets compilation or webpack.config.js. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey there, I had the same issue with AdonisJS v5 where my CSS wasn't being included after building or using Configure Webpack EncoreFirst, run the following command to set up Encore: node ace configure encore Create Entry Point FilesMake sure you have Import CSS in JavaScriptIn import '../css/app.css'; Update Your ViewsInclude entry point scripts and styles in your HTML template. Your view should look like this: <!DOCTYPE html>
<html lang="en">
<head>
@entryPointScripts('app')
@entryPointStyles('app')
</head>
<body>
</body>
</html> Run the Build CommandRun your app with the --watch flag: node ace serve --watch These steps should get your CSS working. More details are in the AdonisJS v5 docs. Hope this helps! |
Beta Was this translation helpful? Give feedback.
Hey there,
I had the same issue with AdonisJS v5 where my CSS wasn't being included after building or using
@entryPointStyle('app')
. Here's how I fixed it:Configure Webpack Encore
First, run the following command to set up Encore:
Create Entry Point Files
Make sure you have
resources/js/app.js
andresources/css/app.css
files. If they don't exist, create them.Import CSS in JavaScript
In
resources/js/app.js
, add this line:Update Your Views
Include entry point scripts and styles in your HTML template. Your view should look like this: