Closed reageek closed 1 year ago
Hi, @reageek I'm too late, sorry for that. I wasn't checking the package. And I was struggling with time. I'm counting to bring new stuff. Starting by re-organizing the documentation.
Glade to hear that the plugin was very helpful.
For the .vue()
issue. The way .vue(), .react(), .extract() and all function that doesn't have src
arg. And that their call is unrelated of the function before it. Which is the case for all functions, or at least the one I mentioned. The way to use them is as follow: mix.js().mix('vue')()
. The mix()
function will return the laravel-mix Mix
instance. And through it the .vue()
would be correct.
Now after looking at it. Besides redoing the documentation. I will add the support to those functions so no need to use .mix('vue')()
for such kind of function. And if in any new version of laravel-mix some new function gets added. I will add a configuration option to be able to add it. And also you can open a PR. And u can use the old .mix()
method.
I'm thinking of adding a new property mapper
. When used. A glob goes first. The functions that don't have src. And an exec()
at the end. That will allow in case needed in any case. Which may never be. To be able to use a glob. And have for every file targeted by the glob to have the chain applied to it as well.
mixGlob.mapper.js('some/globe/*.compile.js', 'dist/').options().exec()
options()
is a function that is expected to run globally. i have no idea what function work following what before it. I'll be checking the functions. I checked some already. But the command above would run the chain bellow:
mix.js('file1.js', 'dist/').options()
mix.js('file2.js', 'dist/').options()
mix.js('file3.js', 'dist/').options()
While running mixGlob.js('some/globe/*.compile.js', 'dist/').options()
after the update would result in:
mix.js('file1.js', 'dist/')
mix.js('file2.js', 'dist/')
mix.js('file3.js', 'dist/')
mix.options()
For options, the second and natural way is to be used. Because it is needed to be called only once.
However by having those implementations. I guess any need will be covered. And the API would be both intuitive for including those no src functions that I didn't and let to be used with mix()
. And if needed. The plugin will be able to run functions against globs.
Any suggestions are welcomed.
I'll work on it this week. I'll handle this the ideal way. And I'll do a re-analysis. Will update u as soon as it's done.
I'm mostly about to finish version 2 of the package. A totally new approach and full re-implementation. that is way more flexible powerful and simple or intuitive. And extensive typescript typing as well. I didn't go for any of the mentions above. For backward compatibility. I'm providing a classic version of the extension. That will keep the same way of usage as the old one. Only for the purpose of having a one-liner change to keep the old code working.
@reageek you should check the v2
it's finally out.
Hello and thanks for this amazing plugin. I have used it on other projects but never before with vue.
I am trying to get this plugin to work with an existing vue app. I experience the error
defaultMapExt: no mapping precised, neither it's supported by default
when building my js/vue components which is very vague and I have not been able to find a solution.I have looked through https://github.com/MohamedLamineAllal/laravel-mix-glob/issues/52 and reread the documentation and have stuck the mapping everywhere that I can think of that might make sense... does this plugin support .vue()?
I have the appropriate vue-loader and vue-template-compiler installed. When I compile without the .vue() command I get the expected
You may need an appropriate loader to handle this file type
. I can successfully compile these using the normal mix.js() with the sources as a stack, and call the .vue() command at the end and it works but it is a lot of files. Hence why I would like to use this plugin.Some assistance or guidance on what I am doing wrong would be appreciated.
My webpack.mix.js contents
Package.json
Compiler output