GithubHelp home page GithubHelp logo

Comments (11)

mxmul avatar mxmul commented on September 14, 2024 2

@FredKSchott I'm also trying to use this plugin with 11ty, and would love to see support for multiple HTML entries. I'd be happy to pick this up myself.

from create-snowpack-app.

yuheiy avatar yuheiy commented on September 14, 2024

What is the execution order of run:* and bundle:*? This relationship does not seem to be documented.

from create-snowpack-app.

yuheiy avatar yuheiy commented on September 14, 2024

If bundle:* is executed after run:* ends, I feel like this plugin would work correctly. After the end of run:*, it should be able to read the fallback file.

https://github.com/pikapkg/create-snowpack-app/blob/6f4e11d3a355c8d72fd80db0483d9faa2d041171/packages/plugin-webpack/plugin.js#L76

from create-snowpack-app.

FredKSchott avatar FredKSchott commented on September 14, 2024

We should document that ordering. Currently, all "run" scripts will complete before the "bundle" script/plugin is run.

from create-snowpack-app.

FredKSchott avatar FredKSchott commented on September 14, 2024

But again, the issue described in OP is that fallback is not required / may not exist in your project if its not an SPA. The plugin should multiple entrypoints instead /product.html, about.html, etc.

from create-snowpack-app.

yuheiy avatar yuheiy commented on September 14, 2024

Oh, I'm sorry. I misunderstood. In order to target the files generated by 11ty I needed the following settings.

snowpack.config.js:

{
  "scripts": {
    "mount:_site": "mount _output --to /",
    "mount:src": "mount src --to /_dist_",
    "run:11ty": "eleventy",
    "run:11ty::watch": "$1 --watch"
  },
  "plugins": ["@snowpack/plugin-webpack"],
+ "devOptions": {
+   "fallback": "../_output/index.html"
+ }
}

from create-snowpack-app.

yuheiy avatar yuheiy commented on September 14, 2024

It looks like we need to modify snowpack module to allow multiple values for the fallback property. Perhaps, like making the default value from index.html to ['index.html'].

from create-snowpack-app.

FredKSchott avatar FredKSchott commented on September 14, 2024

Id rather just add support for the webpack plugin to search for all HTML files in your build directory, and then use those as entrypoints. Right now we're being lazy by just reading from fallback, but that's not really the right use of that config value. The fallback config was just meant for SPAs that wanted it, but all plugins should support the non-SPA use case.

from create-snowpack-app.

FredKSchott avatar FredKSchott commented on September 14, 2024

Tackled via #144, released in 1.3.0

from create-snowpack-app.

dickeylth avatar dickeylth commented on September 14, 2024

Should the readme: https://github.com/pikapkg/create-snowpack-app/tree/master/packages/plugin-webpack#limitations be updated? I guess just add multiple entries to webpack configuration should work?

from create-snowpack-app.

FredKSchott avatar FredKSchott commented on September 14, 2024

Bah, my bad, I read the issue title wrong. We now support multiple entrypoints in the HTML file, but not multiple HTML files.

Would still love some help on this one!

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.