ventojs / vento

🌬 A template engine for Deno & Node
https://vento.js.org/
MIT License
153 stars 9 forks source link

Import error with Nuxt #48

Closed zguig52 closed 3 months ago

zguig52 commented 3 months ago

Hello,

Trying to use VentoJS, but I cannot find a way to use it inside a Nuxt project.

There are issues with import statement. I have tried to transpile it but nothing works. Using latest: "ventojs": "^0.12.2"

The error message is following:

✘ [ERROR] Could not resolve "./src/environment.js"

    node_modules/ventojs/esm/mod.js:2:28:
      2 │ import { Environment } from "./src/environment.js";
        ╵                             ~~~~~~~~~~~~~~~~~~~~~~

✘ [ERROR] Could not resolve "./src/loader.js"

    node_modules/ventojs/esm/mod.js:3:27:
      3 │ import { FileLoader } from "./src/loader.js";
        ╵                            ~~~~~~~~~~~~~~~~~

✘ [ERROR] Could not resolve "./deps/deno.land/x/astring@v1.8.6/src/astring.js"

    node_modules/ventojs/esm/deps.js:3:25:
      3 │ ...as astring from "./deps/deno.land/x/astring@v1.8.6/src/astring.js";
        ╵                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Here you can find a running environment to reproduce it quickly. https://stackblitz.com/edit/github-qytiun-equv3u?file=package.json,app.vue

oscarotero commented 3 months ago

Looks like the NPM build is adding the src folder to the npmignore, so it's not included in the package. I'm fixing it.

oscarotero commented 3 months ago

Can you try now? I just published 0.12.3

zguig52 commented 3 months ago

It works fine now. Thanks a lot for the quick fix! Let's try vento templating language now :)