Closed Niksac closed 2 years ago
Didn't have a Windows computer to test such case, I will fix it in the next update version soon.
@Niksac I have published a beta version laravel-mix-nunjucks@1.2.0-beta.1
, could you please help me test whether it works now?
With your beta version, the Windows path issue is gone.
However, I needed to update the laravel-mix package because the laravel-mix/src/components/Component.js
file, you now use in index.js
was not present in my laravel-mix version (6.0.25).
The file is marked as @internal
by the mix devs, so I would advise against referencing it for now.
Alternatively, the package.json should be upgraded to the new requirements.
Try laravel-mix-nunjucks@1.2.0-beta.2
, I think it could be the candidate release version.
Not working for me:
[webpack-cli] TypeError: Class constructor Nunjucks cannot be invoked without 'new'
Passing an instance when extending fixed it for me:
mix.extend("njk", new Nunjucks);
Looks it's the last issue I need to fix.
v1.2.0
has been published, the issue should be resolved.
v1.2.0
seems to work without issue on windows.
Thank you!
When using Windows, Nunjuck files will not compile unless in "watch" mode. I tracked down the issue to be caused by the
globby
package which does not match for windows paths with backslashes.Using
this.from.path().replace(/\\/g, '/')
as pattern for globby, will work as a workaround until the folks at globby fix it on their end.What do you think?