I created an scss
file as described in the docs. If I run yarn build
, it works as expected: the css
rules are applied. But if I run yarn start
, I don’t find my rules anymore, my scss
file is not inclueded, and the rules are not applied.
My config.json
file:
{
"entry": {
"main": [
"./scripts/main.js",
"./styles/main.scss"
],
"customizer": [
"./scripts/customizer.js"
],
"frontpage": [
"./styles/frontpage.scss"
]
}, ...
The app/setup.php:
<?php ...
add_action('wp_enqueue_scripts', function () {
wp_enqueue_style('sage/main.css', asset_path('styles/main.css'), false, null);
wp_enqueue_script('sage/main.js', asset_path('scripts/main.js'), ['jquery'], null, true);
if (is_single() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
if (is_front_page()) {
wp_enqueue_style('sage/frontpage.css', asset_path('styles/frontpage.css'), false, null);
}
}, 100);
...