Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix injection issues #1862

Merged
merged 4 commits into from
Mar 29, 2017
Merged

Fix injection issues #1862

merged 4 commits into from
Mar 29, 2017

Conversation

QWp6t
Copy link
Member

@QWp6t QWp6t commented Mar 24, 2017

This should hopefully fix issues with browser-sync not refreshing or injecting when changes are made to template files.

Note that we are no longer passing the copy glob to browser-sync. We are only passing php files to it. Webpack handles everything else.

Still a couple of issues to address:

@derkjn
Copy link
Contributor

derkjn commented Mar 24, 2017

Tested this this morning, all seems to be working fine on my end as far as I can tell!
Thanks for the fix @QWp6t!

@QWp6t QWp6t changed the title Fix injection issues (WIP) Fix injection issues Mar 24, 2017
@QWp6t QWp6t self-assigned this Mar 24, 2017
@QWp6t QWp6t changed the title (WIP) Fix injection issues Fix injection issues Mar 27, 2017
@QWp6t QWp6t merged commit 038de19 into master Mar 29, 2017
@QWp6t QWp6t deleted the fix-injection-issues branch March 29, 2017 08:49
@apintocr
Copy link

I confirm this is working after the latest commit 419863e
However the JS might need to be reloaded after as, for example, select2 stops working after the HTML injection takes place.

@TrayWeb
Copy link

TrayWeb commented Jun 9, 2017

Hi Guys,

I still have the same issue on a fresh install of sage 9 beta 3.
CSS files work well but not the blades.

Does anyone still have the same issue ?

@apintocr
Copy link

This commit solved the issue on my previous project, however a fresh install I still have the same issue.

@QWp6t
Copy link
Member Author

QWp6t commented Jun 19, 2017

What version of node are you using?

@TrayWeb
Copy link

TrayWeb commented Jun 19, 2017

Thanks for the reply:

v7.8.0


@QWp6t
Copy link
Member Author

QWp6t commented Jun 19, 2017

I think they removed or renamed the environment variable for 7.x, but I haven't had a chance to look up how it should be done now.

The last I had read about it was in this discussion: nodejs/node#5258

@TrayWeb
Copy link

TrayWeb commented Jun 29, 2017

Hello Guys,
Fixed the issue by changing the watch part on my config.json:

  "watch": [
    "resources/views/partials/*.blade.php",
    "resources/views/layouts/*.blade.php",
    "resources/views/*.blade.php"
  ],

@apintocr
Copy link

@TrayWeb not working for me :(

@TrayWeb
Copy link

TrayWeb commented Jun 30, 2017

Can you please send your config.json file and also the structure of your files ?
Does it work for the css ?

@apintocr
Copy link

@TrayWeb it's a clean sage install using the latest commits from the repository.

Anyway, here's my config.json

{
  "entry": {
    "main": [
      "./scripts/main.js",
      "./styles/main.scss"
    ],
    "customizer": [
      "./scripts/customizer.js"
    ]
  },
  "publicPath": "/app/themes/themename",
  "devUrl": "https://site.dev",
  "proxyUrl": "https://localhost:3000",
  "cacheBusting": "[name]_[hash:8]",
  "watch": [
    "{app,resources/views}/**/*.php"
  ],
  "browsers": [
    "last 2 versions",
    "android 4",
    "opera 12"
  ]
}

I've also tried with your code, no change.

@apintocr
Copy link

apintocr commented Jun 30, 2017

Funny enough I have another project, also with sage (beta-3 here), that has EXACTLY the same webpack files and configuration, it's using the same Trellis vagrant box and it works...

(this is not a clean sage project, it's an already fully developed site)

@waylay
Copy link

waylay commented Jul 7, 2017

@TrayWeb Thanks! Worked for me! This is what I used:

  "watch": [
    "app/*.php", 
    "resources/views/**/*.php", 
    "resources/views/*.php"
  ]

@coffeeneed
Copy link

coffeeneed commented Jul 14, 2017

Thanks, @TrayWeb
I also experienced this (latest commit) problem and can confirm that this worked;

Changing from:

  "watch": [
    "{app,resources/views}/**/*.php"
  ]

too:

  "watch": [
    "resources/views/partials/*.blade.php",
    "resources/views/layouts/*.blade.php",
    "resources/views/*.blade.php"
  ]

Any chance a fix for this will be commited to master any time soon?

@v3nt
Copy link

v3nt commented Dec 29, 2021

was this ever fixed? Started a new project and still not watching blade files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants