Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple sources to destinations #4

Closed
damianobarbati opened this issue Mar 15, 2021 · 6 comments
Closed

Multiple sources to destinations #4

damianobarbati opened this issue Mar 15, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@damianobarbati
Copy link

Is there a solution to support multiple source-destination like v1?

"staticFiles": {
        "staticPath": [
            {
                "staticPath": "assets/robots.txt",
                "staticOutDir": ""
            },
            {
                "staticPath": "assets",
                "staticOutDir": "assets"
            }
        ],
        "watcherGlob": "**"
    },
@elwin013
Copy link
Owner

Helo @damianobarbati!

At this moment there is no feature like this. Maybe in future someone (me or someone else) will add it.

@elwin013 elwin013 added the enhancement New feature or request label Mar 18, 2021
@folknor
Copy link

folknor commented Apr 12, 2021

This would be excellent because in all the static apps I deploy there's loads of assets I don't want exposed in /www - so my /dist folder always looks like /dist/www, /dist/config, etc, and in the config folder I copy in PHP dependencies and such and also files with SMTP passwords for example, but POST entrypoint handling scripts and other static assets need to go in /dist/www.

@elwin013 elwin013 self-assigned this Apr 13, 2021
@Drecu
Copy link

Drecu commented Sep 1, 2021

I think my PR should solve this problem, had the same issue where i have multiple different files under different paths and needed to export them. See my pr #13

@dskelton-cos
Copy link

This feature would be awesome to have in V2

@web1100manager
Copy link

@elwin013 if @Drecu 's solution works can we please get that merged? This would be a huge help. Thank you!

@elwin013
Copy link
Owner

elwin013 commented Jan 2, 2023

Feature is added with 1.5.0 version of plugin. Plugin now allows to things:

  1. multiple configurations (just set staticFiles to array and put as many configs as you wish),
  2. env variable matching (all variables must match), example config:
// package.json
  {
  ...
  "staticFiles": [
    {
      "staticPath": "production.txt",
      "env": {
        "NODE_ENV": "production"
      }
    },
    {
      "staticPath": "development.txt",
      "env": {
        "NODE_ENV": "development"
      }
    }
  ]

@elwin013 elwin013 closed this as completed Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants