bdkjones / CodeKit

CodeKit 3 Issue Tracker
https://codekitapp.com
81 stars 5 forks source link

Recursive @codekit-append/prepend files are ignored #599

Open massimo-cassandro opened 4 years ago

massimo-cassandro commented 4 years ago

I have some js files that I reuse in many project with small changes, and usually I put predefined append / prepends in those files, which are then linked to the files of various projects.

All worked fine until a few versions ago, but now no longer. These are often old projects that I can't use es6 import for, and in any case the use of codekit-append / prepend is often the quickest way.

Skipped files are always in skipped folders (ie: node_modules)

To reproduce:

file1.js

console.log('this is file1');

file2.js

// @codekit-append 'file1.js'

file3.js

// @codekit-append 'file2.js'

file1.js, is ignored when file3.js is compiled

bdkjones commented 4 years ago

First, do you have file3.js set to be minified? If so, do you have the minifier set to drop console.log() statements?

Second, please put together a small demo project and send me a download link. I need a full project (not just files) so I can look at the configuration.

massimo-cassandro commented 4 years ago

@bdkjones: thanks for your quick reply

the previous example is just an attempt to illustrate the problem.

I have at least two rather large projects (which it is impossible to send you as they are) in which the same situation occurred: multiple inclusions of nifidified files using codekit-append / prepend, sometimes (always?) produce a compiled file without some elements.

To explain it better, we have:

file3 (includes file2) file2 (includes file1) file1 (located in node_modules, listed in "skipped folders")

If I save file3, file1 is not included, if I save file2 it's all right

I'm trying to extract a part of the project to send you as soon as possible

Thank you

bdkjones commented 4 years ago

Are you running CodeKit 3.11?

I just tested this situation over here and cannot reproduce the behavior you described in the initial issue. I created one file that was outside of a skipped folder, then two files that were inside of a skipped folder. Each file appended the next file in the chain. When I compiled the one file that was not in the skipped folder, everything got combined correctly.

Additionally, the demo project you sent me was super complex. However, your main file (ada_libs.js) never imports the _src/_ada.datatable.js file, which is why you never see any errors about missing files when you compile ada_libs.js. If you compile _src/_ada.datatable.js, CodeKit correctly shows an error saying that it cannot fulfill one of the imported files.

My hunch is that you're on a really outdated version of the app.

bdkjones commented 4 years ago

The attached test project is what I used to evaluate your initial report:

test.zip

massimo-cassandro commented 4 years ago

I am using the latest version of codekit.

I apologize for the last message, but I'm trying to repair a very old project and I must have made a mess while preparing the files ti send you

In any case, I'm trying to simplify those files and, where possible, to switch to ES modules. Thank you for your support

bdkjones commented 4 years ago

No worries. As far as I can tell, everything is working correctly. If you can get a simplified case that shows the problem (try downloading my test project and modifying it) I’m happy to look into it.