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

polyfills are correctly resolved now, but some crypto polyfill is not implemented yet #10

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { defineNuxtConfig } from 'nuxt/config'

// Add polyfills: https://github.com/nuxt/nuxt/pull/25028
import { Buffer } from 'node:buffer'
import process from 'node:process'
import 'node:crypto';

export default defineNuxtConfig({
app: {
Expand Down Expand Up @@ -61,7 +59,7 @@ export default defineNuxtConfig({
externalVue: false,
},
routeRules: {
'/': { ssr: false },
'/': { ssr: true },
},
imports: {
autoImport: false,
Expand All @@ -73,7 +71,32 @@ export default defineNuxtConfig({
defaultImport: 'component',
global: false,
},
ssr: true,
vite: {
define: {
process: {},
global: 'globalThis',
},
// This is not ideal and should work via `unenv` directly..
resolve: {
alias: {
crypto: './node_modules/unenv/runtime/node/crypto/node.cjs',
// assert: './node_modules/unenv/runtime/mock/proxy.cjs',
http: './node_modules/unenv/runtime/node/http/index.cjs',
buffer: './node_modules/unenv/runtime/node/buffer/index.cjs',
os: './node_modules/unenv/runtime/mock/proxy.cjs',
url: './node_modules/unenv/runtime/node/url/index.cjs',
zlib: './node_modules/unenv/runtime/mock/proxy.cjs',
'process/': './node_modules/unenv/runtime/mock/proxy.cjs',
process: './node_modules/unenv/runtime/mock/proxy.cjs',
stream: './node_modules/unenv/runtime/mock/proxy.cjs',
_stream_duplex: './node_modules/unenv/runtime/mock/proxy.cjs',
_stream_passthrough: './node_modules/unenv/runtime/mock/proxy.cjs',
_stream_readable: './node_modules/unenv/runtime/mock/proxy.cjs',
_stream_writable: './node_modules/unenv/runtime/mock/proxy.cjs',
_stream_transform: './node_modules/unenv/runtime/mock/proxy.cjs',
},
},
css: {
preprocessorOptions: {
scss: {
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@
"nuxt": "^3.11.2",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"unenv": "^1.9.0",
"vite": "^5.2.10",
"vue": "^3.4.26",
"vue-router": "^4.3.2"
},
"dependencies": {
"@encointer/worker-api": "^0.12.4",
"@encointer/worker-api": "^0.12.5-alpha.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't fix anything

"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@material-tailwind/html": "^2.2.2",
"@nuxt/content": "^2.12.1",
Expand All @@ -50,6 +49,7 @@
"nuxt-svgo": "^4.0.0",
"pinia": "^2.1.7",
"sass": "^1.75.0",
"unenv": "^1.9.0",
"vue3-form-wizard": "^0.2.3"
}
}