Trying to raise Symfony 3 on Homestead in Vagrant. But I don’t get access to frontend files by running npm run dev-server .

My webpack.config.js:

 var Encore = require('@symfony/webpack-encore'); Encore .setOutputPath('web/assets/') .setPublicPath('/assets') .cleanupOutputBeforeBuild() .addStyleEntry('css/page1', './assets/page1.scss') .addStyleEntry('css/cabinet', './assets/cabinet.scss') .enableSassLoader() .addEntry('js/assets', './assets/assets_twig.js') .addEntry('js/cabinet', './cabinet.js') .enableSourceMaps( ! Encore.isProduction()) .enableVersioning(Encore.isProduction()) ; module.exports = Encore.getWebpackConfig(); 

After starting the dev-server, I get this manifest.json :

 { "assets/page1.css": "http://localhost:8080/assets/css/page1.css", "assets/cabinet.css": "http://localhost:8080/assets/css/cabinet.css", "assets/assets.js": "http://localhost:8080/assets/js/assets.js", "assets/cabinet.js": "http://localhost:8080/assets/js/cabinet.js" } 

I go to the http://site.test page loads, but without static.

I know that the matter is in http://localhost:8080 but how to fix it, I’m not mad at it. I ask for your help, I haven’t set up with Homestead for 4 hours already, I hope this is the last problem, although I haven’t yet configured the database.

Homestead.yaml

 --- ip: "192.168.10.10" memory: 2048 cpus: 1 provider: virtualbox authorize: D:\Homestead\.ssh\id_rsa.pub keys: - D:\Homestead\.ssh\id_rsa folders: - map: D:\sites to: /home/vagrant/sites sites: - map: site.test to: /home/vagrant/sites/mysite/web type: symfony2 databases: - mysite # blackfire: # - id: foo # token: bar # client-id: foo # client-token: bar # ports: # - send: 50000 # to: 5000 # - send: 7777 # to: 777 # protocol: udp 

    1 answer 1

    I rummaged through the entire @symfony/webpack-encore package and found in it that the dev-server command has the host argument After ./node_modules/.bin/encore dev-server --host site.test command indicated in the question.

    The npm run dev-server --host site.test did not work, so I added my command to package.json

     "dss": "./node_modules/.bin/encore dev-server --host site.test" 

    and using the npm run dss command I launch my frontend collector.