satania.moe icon indicating copy to clipboard operation
satania.moe copied to clipboard

Some updates

Open e965 opened this issue 6 years ago • 8 comments

  • Changed the link for js-yaml lib (because RawGit will close soon)
  • "build" task is fixed (some file paths were wrong)
  • XMLHttpRequest is replaced by fetch

e965 avatar Mar 13 '19 08:03 e965

Okay, so I wanna clarify that both fetch wasn't used and yaml is imported like that for the same reason, back when I made this, satania.moe wasn't running on webpack (actually, I don't think webpack was even popular back then) so I did not use fetch to ensure we were compatible with IE (which is still used a lot by our Chinese visitors) and imported YAML from an URL because I had no other ways to manage dependencies back then lol.

Now it would be better to put YAML as a dependency and add a fetch pollyfill.

Also I'm not sure about what you're doing with gulp-rename there?

Pizzacus avatar Mar 13 '19 14:03 Pizzacus

Also I'm not sure about what you're doing with gulp-rename there?

In the current version of the project, the build paths of some files are broken (e.g. ./dist/src/assets/favicon.jpg instead of ./dist/favicon.jpg). I fixed it.

e965 avatar Mar 13 '19 15:03 e965

(forget the last message I didn't get what you meant)

No this is the intended file structure.

As with most Gulp projects, things in src/ go into dist/, I put assets at the root just because there is no reason not to do that in the built website

Pizzacus avatar Mar 13 '19 15:03 Pizzacus

Or if you meant that for you, things go into ./dist/src/, well, that's weird because it doesn't do it for me

image

(I'm not sure if you meant by "(e.g. ./dist/src/assets/favicon.jpg instead of ./dist/favicon.jpg)" that it's what the change does or if it's what the current script does)

Pizzacus avatar Mar 13 '19 16:03 Pizzacus

¯\(ツ)

(node 10.12.0, npm 6.4.1)

e965 avatar Mar 13 '19 16:03 e965

~~Is your working dir (the dir you are cd into) the root of the satania.moe dir?~~

No wait it does look like it (I am really terrible today oh my god)

Pizzacus avatar Mar 13 '19 16:03 Pizzacus

My working dir is the one into which I have cloned the git repository.

e965 avatar Mar 13 '19 16:03 e965

I have found the problem, it's the use of path.join on globs that makes Gulp confused.

Normally, Gulp can find the "parent" of a Glob, so for instance, in owo/uwu/**/*.js, the parent is owo/uwu, so it is not added when you do gulp.dest.

But the Globs are generated with path.join so on windows, that separates folders with the backslas, while Globs always separate folders with the forward slash.

Solution: path.join will no longer be used to create globs, Gulp's cwd option will be used to do it properly

This will be fixed in an upcoming commit

Pizzacus avatar Mar 13 '19 16:03 Pizzacus