Is there a recommended way to exclude nuxtServerInit
code from the client bundle?
I'm using that function to decrypt a cookie which uses iron
to prepopulate my user's session data,, and that brings with it a whole host of Node dependencies. Many of those deps are written ES6, so uglifyjs throws errors and can't eliminate the code.
I think it would be a good idea to prevent that code from being sent to the client, since in this and presumably other cases, it leaks info about the backend to the client.
My current thought was to spilt my nuxtServerInit
code into a new file, and somehow configure webpack to import a fake version of it when building the client bundles.