Sterc / modx-minify

9 stars 5 forks source link

@import Issue #36

Open kolbykruger opened 6 years ago

kolbykruger commented 6 years ago

I am creating a separate issue, although it may relate to #34

Issue

When importing a .scss file into another, it works correctly, however importing a .css file with import does not work.

Currently I have @import "variables.scss"; which is working correctly. Doing anything with a regular css file, i.e. @import "reset.css"; or @import "reset"; refuses to compile and errors out.

All of the StackOverflow posts I have found regarding this issue say that @import "reset"; should work, and does in current versions.

A simple fix would be for me to rename reset.css to reset.scss however in MODX we use this reset.css file in conjunction with TinyMCE RTE to style the richtext editor to look like the live page. TinyMCE RTE cannot accept a .scss file because it is not compiled before specified, and you cannot specify the path to the compiled .css file because it changes based on the modified date and version.

To fix this, we could go two routes:

Solution 1

Allow us to manipulate the compiled file name to something we specify in the system settings, which then gets appended with a ?v=*modified-date* therefore the path is always the same. This would allow us to specify the end file for TinyMCE RTE to read off of.

Solution 2

Update the php compiler to work with modern .scss and .less. This is obviously ideal but a much larger job (I would imagine).

Unfortunately I know nothing close to what I would need to, to help with this. If anyone has some direction on an alternate solution, or some hack that you have found, I would love to know.

I am on MODX Slack if you want to message me directly with any questions: @sargasm

Thanks