Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Build .css file with custom changes, to load in beginning of document

1Relation premium asked 1 year ago


How is it possible to not only building the main.js, but also the .css file.

I understand that .js loads the CSS styles, but as main.js is loaded at the end of the document, all styles are loaded in the end. I could use the default css file, but then (cause my custom theme), it will load default colors, and then change when main.js is loaded.

Loading main.js at the beginning causes webpage elements to work incorrectly.

How can I get a .css version of my build, that I can preload?


Grzegorz Bujański staff answered 1 year ago


Have you tried using our webpack starter to create such a build? https://mdbootstrap.com/docs/standard/getting-started/webpack-integration/


1Relation premium commented 1 year ago

Followed this exact guide, no where does it say how to get the .css file builded, only main.js


Grzegorz Bujański staff commented 1 year ago

In case of webpack you can use this plugin: https://webpack.js.org/plugins/mini-css-extract-plugin/#using-preloaded-or-inlined-css



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Premium
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 6.4.0
  • Device: Computer
  • Browser: Firefox
  • OS: Windows
  • Provided sample code: No
  • Provided link: No