ventojs / vento

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

Import error with Nuxt #48

Closed zguig52 closed 8 months ago

zguig52 commented 8 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 8 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 8 months ago

Can you try now? I just published 0.12.3

zguig52 commented 8 months ago

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