Open udf2457 opened 2 years ago
Maybe the docs were not up to date when you created this issue, but here is the solution for the missing aliases dev
, watch
...:
Add the following into your package.json
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"build": "encore production --progress"
}
Apologies for the obscure title but I'm ramming my head against a brick wall here !
According to the docs, all you need to do is:
composer require symfony/webpack-encore-bundle
yarn install
But although the commands run successfully on my machine, the result is something that does not work. Because if we proceed further (as instructed "You can skip the rest of this article and go write your first JavaScript and CSS by reading Encore: Setting up your Project!"), we are told that we can run commands such as:
yarn watch
yarn dev
yarn build
But this is evidently far from the truth:
Following internet searches, I have tried
yarn install --production=false
but it makes no difference. Equally runningcomposer require webpack
makes no difference and neither doesrecipes:install symfony/webpack-encore-bundle --force -v
.There is no
node_modules/.bin/encore
andpackage.json
makes no mention of anything (it only lists my own@popperjs/core
andbootstrap
yarn additions).So it seems somebody has been over-optimistic about the minimal steps required to get it working, and it would be nice to see the docs corrected accordingly !
My environment
yarn version v1.22.19 node v18.4.0 PHP 8.1.7 Debian bullseye
My symphony dir was created using
composer create-project symfony/skeleton:"6.1.*" foobar
and all yarn commands are being run within that directory (i.e. I'm not being silly and running it somewhere else)