denoland / examples

Examples with Deno.
83 stars 22 forks source link

Manage dependencies using `deps.ts` in vue example #24

Open bitsnaps opened 1 year ago

bitsnaps commented 1 year ago

Hi,

Normally deno look into deps.ts for dependencies, however we still need to manually set the reference of dependencies with the exact version (semver). I'm not using trex neither any other similar tool, because I believe this is the recommended way to manage [dev_]deps.ts?

Here is the deps.ts file:

export { defineConfig } from 'npm:vite@^4.3.9'
export { Application, Router } from "https://deno.land/x/oak/mod.ts"
export { oakCors } from "https://deno.land/x/cors/mod.ts"

// I tried all these combinations but none of them work:
// export * from 'npm:@vitejs/plugin-vue@^4.2.3'
// export { vue } from 'npm:@vitejs/plugin-vue@^4.2.3'
// export * from 'npm:vue@^3.3.4'
// export { vue } from 'npm:vue@^3.3.4'
// export { createRouter, createWebHistory } from 'npm:vue-router@4'

At the moment all referenced dependencies work fine except those in comments, so -AFAIK- referencing defineConfig in vite.config.mts should be done like so:

import { defineConfig } from 'deps.ts';

but It didn't work either, we must use import { defineConfig } from 'npm:vite@^4.3.9', any explanation for this behavior?

bitsnaps commented 3 months ago

Here is a related issue with Pinia, where it's flagged as a node compatibility issue, although the creator of Pinia confirms he does not use any specific Node.js API.