https://discord.cloudflare.com logo
Join Discord
Powered by
# functions
  • w

    Walshy | Pages

    04/16/2023, 12:40 AM
    Private beta yep
  • w

    Walshy | Pages

    04/16/2023, 12:40 AM
    That blog was just the announcement, they entered private beta a little bit ago
  • z

    zszszsz

    04/16/2023, 12:43 AM
    Hmm is it possible that we may have raw client sockets in the future ?
  • p

    Plotzes

    04/17/2023, 9:35 PM
    how can i tell wrangler to bundle .css files as a literal string, i want to use a stylesheet in my function
  • p

    Plotzes

    04/17/2023, 9:36 PM
    but when i do
    console.log(css)
    it will just give me
    {}
  • p

    Plotzes

    04/17/2023, 9:36 PM
    which is not correct, because my css file is actually
    Copy code
    css
    #page {
        border: 1px solid red;
    }
  • k

    kian

    04/17/2023, 9:37 PM
    https://developers.cloudflare.com/workers/wrangler/bundling/
  • k

    kian

    04/17/2023, 9:37 PM
    Copy code
    toml
    rules = [
      { type = "Text", globs = ["**/*.css"], fallthrough = true }
    ]
  • p

    Plotzes

    04/17/2023, 9:37 PM
    i thought pages functions didnt support wrangler.toml
  • k

    kian

    04/17/2023, 9:37 PM
    good point
  • k

    kian

    04/17/2023, 9:37 PM
    yeah I don't think you can then
  • p

    Plotzes

    04/17/2023, 9:37 PM
    hmm sad
  • z

    zszszsz

    04/17/2023, 9:38 PM
    use advanced mode
  • z

    zszszsz

    04/17/2023, 9:38 PM
    and bring your own esbuild config
  • z

    zszszsz

    04/17/2023, 9:38 PM
    wait
  • p

    Plotzes

    04/17/2023, 9:39 PM
    but wouldn't that remove the automated routing functionality
  • j

    James

    04/17/2023, 9:39 PM
    yeah you could that, but yeah you'd have to handle routing yourself
  • z

    zszszsz

    04/17/2023, 9:39 PM
    If it is string literal, why not try renaming it to .css.txt or use ASSETS.fetch
  • j

    James

    04/17/2023, 9:39 PM
    but yeah I'd probably do this ^. Publish it, and then
    env.ASSETS.fetch
    to pull it
  • z

    zszszsz

    04/17/2023, 9:40 PM
    It brings me back that talk between me and Walshy days ago
  • p

    Plotzes

    04/17/2023, 9:40 PM
    hmm yeah i guess thats probably the best way then, even though i dont really need the css file to actually be online
  • p

    Plotzes

    04/17/2023, 9:41 PM
    but it would work ¯\_(ツ)_/¯
  • p

    Plotzes

    04/17/2023, 9:41 PM
    so thx
  • z

    zszszsz

    04/17/2023, 9:41 PM
    I was like "let's make a esbuild plugin to copy the routing feature"
  • z

    zszszsz

    04/17/2023, 9:42 PM
    But you know wrangler would really go through
    ./functions
    first for a list of endpoints
  • k

    kian

    04/17/2023, 9:42 PM
    I'm not sure if Pages even leverages the default rule for
    .txt
  • p

    Plotzes

    04/17/2023, 9:43 PM
    i think they do because they do show an example of HTML
  • p

    Plotzes

    04/17/2023, 9:43 PM
  • z

    zszszsz

    04/17/2023, 9:44 PM
    Or esbuild itself has a default loader for .txt. I don't how wrangler would config it
  • h

    HardAtWork

    04/17/2023, 9:45 PM
    What if you do —loader .css=Text
1...372373374...392Latest