I work in a Symfony 4.2 project, and try to use Bootstrap theming (so I need to compile Sass code). I followed the process given in the official doc, which indicates to use webpack-encore. But I have an error when using it accordingly to the doc.
Here is the page indicating the process : https://symfony.com/doc/current/frontend/encore/simple-example.html
So I installed Encore, and then I launch yarn run encore. And here is what it says in the terminal :
yarn run v1.16.0
warning package.json: No license field
error Command "encore" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
So I visited the site indicated in the error, which says :
You may define scripts in your package.json file.
And if I look in my package.json in the root directory, it indeed only says :
"devDependencies": {
"bootstrap": "^4.3.1",
"jquery": "^3.4.1",
"node-sass": "^4.12.0",
"popper": "^1.0.1",
"sass-loader": "^7.0.1"
}
}
There is no script for any encore command :-(
However the rest seems good. Here is an extract of composer.json :
...
"require": {
...
"symfony/webpack-encore-bundle": "^1.5",
...
},
...
And I have a webpack.config.js .
I runned composer require encore and yarn install without any error.
But nowhere in the Symfony doc I found anything about tweaking the package.json oO So how do I make it work ? Why doesn't the yarn run encore work ?