fekiri malek
fekiri malek

Reputation: 376

PhpStorm virtual file splitting

I can't find a more appropriate. I'm using PhpStorm to create web content (php, html, css, js..) and I'm facing the problem of long files (not even so long few hundred lines enough to be lost) where it gets hard to find things and remove unnecessary content.

I was wondering if there is a functionality, plugin or external file manager where it creates different files from one file on disk.

For example: when we have a .css file, for sure it's content is dealing with different features/parts of the html but they are all on the same html page. So it's a bad idea to create different .css file for each part, but it would be nice to have different virtual files for each part/feature where we can code and debug separately our code; but they are saved to same file.

Lets say:

  1. common_header.css: deals with headers
  2. common_menu.css: deals with menu (some menu we have on our page)
  3. common_footer.css: deals with what ever to the end of page
  4. ... and so on

So now while coding we see different files (best as a subtree of the original file) some thing like that on file manager:

But when on disk they are all on the same file common.css that is loaded to our browser as one too.

Upvotes: 0

Views: 105

Answers (1)

Ahatius
Ahatius

Reputation: 4875

If your target is to reduce the number of files being loaded from your server, after the application has been deployed, you might merge and compress your files as shown here.

In case you don't want to waste computing time to compress the files on each call, you could adjust your build process to generate them once during build (something like minify).

Upvotes: 0

Related Questions