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
feat: mode for plugin #4592
feat: mode for plugin #4592
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #4592 +/- ##
==========================================
+ Coverage 91.02% 91.07% +0.04%
==========================================
Files 61 61
Lines 2196 2208 +12
Branches 527 533 +6
==========================================
+ Hits 1999 2011 +12
+ Misses 179 178 -1
- Partials 18 19 +1
Continue to review full report at Codecov.
|
Will add a pr for doc |
This is awesome @clarkdo |
@clarkdo Hello, I am using I did some trial and error, moving backwards through available I did not create a reduced test since I am curious if you will simply reproduce bug right away when using |
@curtisbelt I’ll look into it, thank you for the reporting 🙏 |
Hi @curtisbelt Is your plugin specified ssr:false or the file extension is.client/server.js ? If yes, it won’t be loaded in server side |
@clarkdo I experience the same on latest nuxt edge for https://github.com/Developmint/developmint.de |
I'm wondering how the tests are passing. It may be a breaking change for some special usage. @manniL @curtisbelt could you please help to reproduce it? |
@clarkdo You need nuxt.config.js module.exports = {
modern: 'server',
plugins: [
{ src: '~/plugins/test', ssr: false }
]
} plugins/test.js window.test = true
console.log('TRIGGERED') I can confirm that it works before #4592 (latest working version: nuxt-edge@2.4.0-25754270.4fb220c9) |
Update: fix @ #4659 |
Types of changes
Description
The idea is from @Atinux , use
.server.js
or.client.js
to automatically detect server/client side plugin.mode: 'client|server'
in plugin optionsssr
in plugin options and usemode: 'client|server'
instead, for now auto adaptssr: false
tomode: 'client'
and show deprecating log.server/client
plugin on file ext like:server.js
orclient.js
(specified options has higher priority)Checklist: