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

WARNING: You should add "svelte" to the "resolve.conditionNames" array in your webpack config. #31

Open
artfulrobot opened this issue Feb 21, 2023 · 3 comments

Comments

@artfulrobot
Copy link

I've used this extension for years - thank you - but I came to use it again today on a new project and when doing npx mix I get this warning:

WARNING: You should add "svelte" to the "resolve.conditionNames" array in your webpack config. See https://github.com/sveltejs/svelte-loader#resolveconditionnames for more information

I have tried the following in my webpack.mix.js to no avail:

mix                                                   
  .js('src/adminux.js', 'dist')
  .webpackConfig({
    resolve: {
      alias: {  
        svelte: path.resolve('node_modules', 'svelte')
      }, 
      conditionNames: ['svelte']                      
    },
  })                                                  
  .svelte();

I tried it without the alias bit too - trying to copy bits from https://github.com/sveltejs/svelte-loader

@morpheus7CS
Copy link
Contributor

Hey @artfulrobot,

thanks for letting me know. I will try to check this out by the end of the week and see if I can come up with any solutions.

If you (or anyone else using the package) come up with anything in the meantime, feel free to pull request the changes.

On that note, I'm also hoping to bring this package to v1 sometime sooner rather than later, with Vite support included, so that people can keep using it even on newer Laravel versions.

Thanks again and kind regards,
g

@artfulrobot
Copy link
Author

@morpheus7CS Sounds good. I'm just ignoring it for now as to be honest, for me, the whole point of using laravel mix was so I didn't have to learn webpack/others! Everyone's talking about Vite and I feel another learning curve coming on! 😩

@morpheus7CS
Copy link
Contributor

Hey @artfulrobot,

I have included the link to the issue that previously existed in the svelte-loader repository, which describes the problem much like you described.

@alesvaupotic helped out today by diving deeper into the issue, since I found it weird that the compilation itself doesn't seem to be affected, only the error remains.

So far, our code will remain as is, but we will put in a sensible default as soon as we can hook into it.

So, I think we can monitor the situation on the svelte-loader side, but mostly I think you can be sure that despite the warning your compilation should continue to work as it has.

Kind regards,
g

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

No branches or pull requests

2 participants