Giter Site home page Giter Site logo

Comments (14)

FredKSchott avatar FredKSchott commented on August 9, 2024 3

NIce! Yea, this seems like a more complex integration since it needs to understand your file tree (most of our builds right now are single-file input->output). But, would love to use this as framework for supporting a more complex plugin like this.

i'm fully focused on getting v2.0.0 released this week, so no rush on my end. I'll ping this thread next week tho, happy to help where I can.

from create-snowpack-app.

FredKSchott avatar FredKSchott commented on August 9, 2024

Happy to kick this off:

  • how does Routify work?
  • Does it read your file system as a part of some build/bundle step?
  • However it detects your file system roots, how can we recreate that as a build script plugin?

I'm happy to answer that last question if someone can shed some light on how Routify works.

from create-snowpack-app.

karanganesan avatar karanganesan commented on August 9, 2024

cc @jakobrosenberg

cross posted the issue on Routify too roxiness/routify#176

from create-snowpack-app.

karanganesan avatar karanganesan commented on August 9, 2024

@FredKSchott <-> @jakobrosenberg

roxiness/routify#176 (comment)

from create-snowpack-app.

jakobrosenberg avatar jakobrosenberg commented on August 9, 2024

Hi @FredKSchott

Routify itself is very simple from a build perspective. It scans your pages folder and outputs a routes.js with all your route information. I haven't had time to try Snowpack yet, but it's at the top of my list. As such this conversation might be more productive after I've had time to try it out - unless someone else is willing to try porting the current starter template and sharing the experience.

from create-snowpack-app.

FredKSchott avatar FredKSchott commented on August 9, 2024

Closing since I haven't seen any activity (and I'm on a clean-out-the-issues kick) but happy to reopen if this is something anyone is still interested in pursuing

from create-snowpack-app.

jakobrosenberg avatar jakobrosenberg commented on August 9, 2024

I'm trying out Snowpack for our upcoming framework, Roxi. Very excited! Is it possible to run Snowpack programmatically?

I have found references to import { install } from 'snowpack', but I haven't found any usage examples and the install variable seems undefined.

from create-snowpack-app.

jakobrosenberg avatar jakobrosenberg commented on August 9, 2024

Currently handling it like this:

  process.argv.push('--config', '_roxi/snowpack.config.js')
  require('snowpack/dist-node/index.bin')

@FredKSchott is it possible to import absolute paths with Snowpack?

from create-snowpack-app.

FredKSchott avatar FredKSchott commented on August 9, 2024

It's on our roadmap, would love some help if you're interested in contributing!

FredKSchott/snowpack#312

re: importing absolute paths, I don't think that's supported in your application code. The closest thing we have is https://www.snowpack.dev/#project-relative-imports

from create-snowpack-app.

jakobrosenberg avatar jakobrosenberg commented on August 9, 2024

@FredKSchott I would love to contribute. Maybe when I get a little more familiar with Snowpack.

I tried mapping the absolute paths to relative paths, but had no luck using mount. Then I tried transforming absolute paths to relative paths imports using script, but scripts don't seem to support inline code. Lastly I tried a quick inline plugin, but learned that plugins have to be strings.

A) Is it possible to transform files directly in snowpack.config.js?

B) Is it possible to alias a mount? Roxi has a roxi package and Roxi projects have a roxi folder in the root containing configs and generated runtime code. Optimally I would be able to alias the local roxifolder as runtime or similar.

from create-snowpack-app.

FredKSchott avatar FredKSchott commented on August 9, 2024

@jakobrosenberg you should be able to this:

"scripts": {
  // Example 1: mount "./roxy" folder to "/roxy/*" URLs
  "mount:roxi": "mount roxi"
  // Example 2: mount "./roxy" folder to "/runtime/*" URLs
  "mount:roxi": "mount roxi --to /runtime"
}

from create-snowpack-app.

FredKSchott avatar FredKSchott commented on August 9, 2024

Right now we don't support objects/functions in your "plugins" array, but we do support relative paths to import a plugin:

"plugins": ["./my-custom-plugin.js"]

from create-snowpack-app.

jakobrosenberg avatar jakobrosenberg commented on August 9, 2024

@FredKSchott sorry, I just realized I could have explained B better. If I have both a roxi folder and a roxi package and I mount roxi to runtime, the roxi package is no longer available.

At the moment I'm handling it by prefixing the roxi folder as _roxi.

from create-snowpack-app.

FredKSchott avatar FredKSchott commented on August 9, 2024

Ah, gotcha. Yup, that's a limitation of the current system. We should detect this and warn you ahead of time, on startup

from create-snowpack-app.

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.