Giter Club home page Giter Club logo

Comments (23)

jeffschwartz avatar jeffschwartz commented on August 22, 2024

Set manifest: true in your configuration file, run Buster and post the content of the generated buster.manifest.json file here.

As the documentations states, all paths to assets must be site relative. Your script tag is using a page relative path. It just so happens to be in the same folder as your another_test.js file so it might work but Buster my still fail.

from buster.

ultra0000 avatar ultra0000 commented on August 22, 2024

Actually, i just figured out the issue.
This what my config file looked like:

{
    "options": {
        "verbose": true,
        "manifest": true
    },
    "directives": [
	  "index.html:2",
	  "test.js:3",
	  "another_test.js:3"
    ]
}

I added in ./ to the beginning of each file and it seems to have fixed the issue. I suppose i'll close it now.

from buster.

jeffschwartz avatar jeffschwartz commented on August 22, 2024

@ultra0000 glad you got it working. If you find Buster useful I hope you wouldn't mind starring ๐ŸŒŸ
the repo. You'd be surprised how much that helps keep me motivated to continue supporting this project :).

from buster.

ultra0000 avatar ultra0000 commented on August 22, 2024

Actually, I just now remembered why I did it like that. If I do that, then the reference looks like this:
<script src=./another_test.b2730f541d9682bc5e9a7d65c2872ee9.js">
Should I make a separate issue for this? Also yes, I did star it. It's pretty useful!

from buster.

jeffschwartz avatar jeffschwartz commented on August 22, 2024

from buster.

ultra0000 avatar ultra0000 commented on August 22, 2024

It's missing a " right after the src=. Here's a comparison between how it looks like and how it should look like:
<script src="./another_test.b2730f541d9682bc5e9a7d65c2872ee9.js"> <- It should look like this.
<script src=./another_test.b2730f541d9682bc5e9a7d65c2872ee9.js"> <- But it looks like this.

from buster.

jeffschwartz avatar jeffschwartz commented on August 22, 2024

Sorry, I should have spotted it earlier. The correct site relative url to use in your script tag is /another_test.js. Also, you will need to actually run your page on a server for the paths to be resolved correctly when loading the page. You can use live-server or any other development server that you prefer.

from buster.

ultra0000 avatar ultra0000 commented on August 22, 2024

Yes, i am using a server. Once i changed the tag to what you said, it works perfectly fine.
Thanks for replying to my issue and for making this tool!

from buster.

jeffschwartz avatar jeffschwartz commented on August 22, 2024

My pleasure and thank you :)

from buster.

ultra0000 avatar ultra0000 commented on August 22, 2024

Ok, I think I might be blind, I just now noticed how it's still doing it. I can make a separate issue if you want me to.

from buster.

jeffschwartz avatar jeffschwartz commented on August 22, 2024

I'll reopen this one.

from buster.

jeffschwartz avatar jeffschwartz commented on August 22, 2024

Can you put your code up on Github and I'll use that to address the issue. Just post the repo url here and I will clone it.

from buster.

ultra0000 avatar ultra0000 commented on August 22, 2024

Well, the issue is easy to replicate. The file I'm uploading has just some test I made, with empty JavaScript files, because I noticed this issue in a project I was using it in, and I decided to check if it was an issue with the tool or if I had configured something wrong. I don't think a repo is needed for this.
buster_testing.zip
But, if you need it, I can make the repo of the project I was actually using it in public.

from buster.

jeffschwartz avatar jeffschwartz commented on August 22, 2024

Actually that won't be necessary. I have created a test environment and I have noticed that the module that actually generates the file hashes (md5-file) is returning duplicate hashes. The module hasn't been updated in a very long time. I am going to replace it with another module (md5). I can't promise when this will get done as I am multitasking between projects right now but I should have something to report in a few days.

from buster.

ultra0000 avatar ultra0000 commented on August 22, 2024

Alright, I can wait.

from buster.

jeffschwartz avatar jeffschwartz commented on August 22, 2024

If your files are empty then they will generate the same hash. Buster generates hashes based on file content and not names. Sorry if the docs do not make that clear. Please add some varying content in them and retest. Should work just fine. And please follow up so I can close out this issue :).

from buster.

ultra0000 avatar ultra0000 commented on August 22, 2024

I did actually put different content in each of them, but I emptied them when I put together the ZIP file.

from buster.

jeffschwartz avatar jeffschwartz commented on August 22, 2024

Is it working for you with content in your files?

from buster.

ultra0000 avatar ultra0000 commented on August 22, 2024

It does the things I've mentioned before.

from buster.

jeffschwartz avatar jeffschwartz commented on August 22, 2024

Let's try this:

Create new folder and run npm init -y.

Make that folder the CWD. Once in the folder, run npm i -D @4awpawz/buster.

Open package.json and set its "main" property as `"main": "index.js".

Create index.js in the root of the folder you created.

Copy the following script into index.js:

const buster = require("@4awpawz/buster");
console.log("I am here!");
(async () => await buster({
    options: {
        manifest: true,
        verbose: true,
        ignore: ""
    },
    "directives": [
        "./index.html:2",
        "another_test.js:1",
        "test.js:1"
    ]
}))();

Copy your index.html, another_test.js and test.js files (all with content please) to the root of the folder that you created.

In your terminal in the folder you just created run node index.js`.

The result should be what you are hoping for.

from buster.

ultra0000 avatar ultra0000 commented on August 22, 2024

I have tried it, and yes, it now works perfectly fine! Thank you.

from buster.

jeffschwartz avatar jeffschwartz commented on August 22, 2024

from buster.

jeffschwartz avatar jeffschwartz commented on August 22, 2024

Now explicitly stating that Buster uses content and not file names to generate hashes. See 6b1f132

from buster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.