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: update relative paths in all html files #30

Closed ramjamx closed 3 years ago

ramjamx commented 3 years ago

Question

I am missing some configuration in order to get all html files updated with relative paths?

My configuration is:

    "parcel-plugin-structurize": {
        "rules": [
      {
                "match": "*.html",
                "folder": "."
            },
            {
                "match": "*.js",
                "folder": "js"
            },
            {
                "match": "*.css",
                "folder": "css"
            },
            {
                "match": "*.{png,svg,jpg,jpg2,jpeg,gif,bmp,webm}",
                "folder": "img"
            }
        ]
    },

I am running the build command, index.html is updated to relative css,js and images path but no other html files in the src folder.

these are my scripts:

    "scripts": {
        "postcss:watch": "postcss src/assets/css/index.pcss -o src/assets/css/index.css --env development -w",
        "postcss:build": "postcss src/assets/css/index.pcss -o src/assets/css/index.css --env production",
        "parcel:serve": "parcel src/index.html",
        "parcel:watch": "parcel watch src/*.html",
        "parcel:build": "parcel build src/*.html --detailed-report",
        "clean": "rm -rf dist .cache",
        "build": "npm-run-all -s clean postcss:build parcel:build",
        "start": "npm-run-all -s clean -p postcss:watch parcel:serve"
    },

The result is index file updated with relative paths but not other html files.

Information

samrith-s commented 3 years ago

Hello @ramjamx sorry for the delayed response. Could you create a minimal reproducible repo? I'll have a look!

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.