Answer the question
In order to leave comments, you need to log in
What is the best way to organize work with css, on webpack and php back?
Hello!
I used to sit on a gallop, but it seems to me that the assembler is certainly good, even excellent, but now it’s not about him at all, but about WebPack.
There is a server (which generates essentially static html pages, on Laravel 5.3++). Composite blocks are scattered from resources/views and further into folders, which are assembled into a finished page according to certain routes.
JS I divided into something similar, (suppose we know the current sections of the site, and the future ones will pass through us and we will write code for them (front). And we will create a kind of routing. And our entry point into the application. Consisting of 1 js. Its task is to get the current url and call the main js file special for it, via require.ensure.He, in turn, connects the necessary components, libraries, etc. depending on the
needs.I also want to use PostCSS with ModuleCss on the project.But how to use this modularity?If the main rendering of the page is done by Laravel (a certain php framework, with its own blade.php templates).
'use strict';
import styles from './css/main.css';
module.exports = function() {
let page = document.querySelector('.page');
page.innerHTML = '<p class="'+ styles.page + '">параграф, со стилями из main.css, класса page</p>';
};
{
"title": "_title_xkpkl_5 _title_116zl_1",
"article": "_article_xkpkl_10",
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question