samrith-s / parcel-plugin-structurize

A plugin to customize the output (dist) directory structure during production.
MIT License
41 stars 6 forks source link

[❔] Question: Directory structure is not being followed. #54

Closed jjaimealeman closed 3 years ago

jjaimealeman commented 3 years ago

This is my first time ever opening an issue, so I hope I am doing this correctly and providing enough feedback 👍

Question

I followed the usage instructions as provided. But the folders I outlined in parcel-plugin-structurize.json are not being moved/copied over on npm run build command.

My Version Information:

// parcel-plugin-structurize.json
{
    "rules": [
        {
            "match": "*.css",
            "folder": "src/css"
        },
        {
            "match": "*.{jpg,png,gif,svg}",
            "folder": "src/icons"
        },
        {
            "match": "*.{jpg,png,gif,svg}",
            "folder": "src/images"
        },
        {
            "match": "*.js",
            "folder": "src/js"
        }
    ]
}

This is what my structure looks like https://i.imgur.com/oktrIjF.png

The expectation was/is that your plugin maintains the same structure after running the npm run build command. This is what it looks like:

  "scripts": {
    "dev": "npm-run-all --parallel dev:*",
    "dev:parcel": "parcel serve ./src/index.html",
    "dev:css": "tailwindcss -i src/css/tailwind.css -o src/css/styles.css -w",
    "build": "npm-run-all clean css parcel",
    "clean": "rm -rf dist/*",
    "css": "tailwindcss -i src/css/tailwind.css -o src/css/styles.css",
    "parcel": "parcel build src/index.html"
  },

After running npm run build, this is the resulting output https://i.imgur.com/q3GTLEk.png

Am I doing something wrong?

samrith-s commented 3 years ago

Hey @OrganizedFellow,

Thanks for the report. Unfortunately, this plugin only works for Parcel v1 and is not updated for v2 (yet).