Giter Club home page Giter Club logo

Comments (11)

c4software avatar c4software commented on July 22, 2024 2

@FredKSchott Its working really well Sample

I will do a quick sample using http-vue-loader this week-end.

from snowpack.

FredKSchott avatar FredKSchott commented on July 22, 2024 1

@c4software Huh, marked & prism are interesting. I actually never realized that UMD packages would be supported by default just due to the fact that they don't have any imports to worry about. ๐Ÿง

+1 for a full example. No one really publishes .vue files to npm (correct me if I'm wrong on this!) so then the only concern is just getting an example of a .vue source file being compiled correctly using @pika/web dependencies.

from snowpack.

c4software avatar c4software commented on July 22, 2024

Hi,

It's a good question. With the latest Vue package on NPM there is a problem, the ยซ advertised ยป package for module is "module": "dist/vue.runtime.esm.js".

It's great (if you don't need templating), but in the dist folder there is an another ESM build (i think the one we want) vue.esm.browser.js.

With the current version of @pikapkg/Web we can't choose which ESM build to pick, so for me, with VueJS we are stuck with the current packaging configuration.

PS: I know its not directly related to pikapkgโ€ฆ

from snowpack.

FredKSchott avatar FredKSchott commented on July 22, 2024

@c4software you actually can point to the correct file, if you'd like. See here, where I got around a package that only exported a "main" entrypoint: lukejacksonn/perflink#15

As for .vue dependencies, they probably won't install correctly. @pika/web doesn't do any transpilation, and my understanding is that .vue files are not valid JS.

If you mean that you are writing .vue source files, then @pika/web dependencies should work like any other import! If someone can get an example together, I'd love to add it to the EXAMPLES list!

from snowpack.

c4software avatar c4software commented on July 22, 2024

@FredKSchott Perfect ! I had to upgrade Pikapkg/Web but its working flawlessly ๐Ÿ‘

Capture dโ€™eฬcran 2019-04-11 aฬ€ 08 29 24

And for the .vue files are indeed not valid JS, those file are transpiled when bundling, but (i didn't try it) there is a http-vue-loader package on github : https://github.com/FranckFreiburger/http-vue-loader

from snowpack.

lroal avatar lroal commented on July 22, 2024

Thanks for great responses. So, in theory, .vue source files should work if transpiled when bundling it or we could use the http-vue-loader ?
It would be great if someone could provide a full example.

from snowpack.

orozot avatar orozot commented on July 22, 2024

@FredKSchott Its working really well Sample

I will do a quick sample using http-vue-loader this week-end.

@c4software Thanks for your example, but i got a mistake when follow your webDependencise config. It's always show
Error: Cannot find module '/app/node_modules/vue/dist/vue.esm.browser.js/package.json'
Have you seen this problem before?
Here is the sample code https://glitch.com/~vue-esm-test

from snowpack.

FredKSchott avatar FredKSchott commented on July 22, 2024

@orozot try updating @pika/web, you may be using an older version

from snowpack.

c4software avatar c4software commented on July 22, 2024

@orozot Yep update @pika/web and the problem will be fixed

from snowpack.

zimmicz avatar zimmicz commented on July 22, 2024

Hi,
should vue imports be working at this stage? I've set up snowpack using

const commonjs = require('rollup-plugin-commonjs');
const vue = require('rollup-plugin-vue');

module.exports = {
  rollup: {
    plugins: [
      commonjs(),
      vue(),
    ],
  },
};

Serving it with npx servor --reload I get
Loading module from โ€œhttp://localhost:8080/src/App.vueโ€ was blocked because of a disallowed MIME type (โ€œapplication/octet-streamโ€). when loading the app.

from snowpack.

FredKSchott avatar FredKSchott commented on July 22, 2024

Right now Snowpack is a purely dependency-transforming tool, so you'll need to to set up Babel or another source tool for source code transformation.

Snowpack v2 will have a built in dev server for you to use as well. You can track progress in #270.

You should also check out Vite: the unbundled dev server from the Vue team that works with Snowpack: https://github.com/vuejs/vite

from snowpack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.