Comments (23)
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.
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.
@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.
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.
from buster.
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.
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.
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.
My pleasure and thank you :)
from buster.
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.
I'll reopen this one.
from buster.
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.
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.
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.
Alright, I can wait.
from buster.
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.
I did actually put different content in each of them, but I emptied them when I put together the ZIP file.
from buster.
Is it working for you with content in your files?
from buster.
It does the things I've mentioned before.
from buster.
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.
I have tried it, and yes, it now works perfectly fine! Thank you.
from buster.
from buster.
Now explicitly stating that Buster uses content and not file names to generate hashes. See 6b1f132
from buster.
Related Issues (20)
- When called with params configuration, shouldn't check for any other source
- Lockdown project dependencies including descendants
- Setting paramsConfig to a default value of {} to indicate that it wasn't passed breaks configuration and causes Buster to crash.
- When reading a configuration file that doesn't exist the exception handler returns {} which breaks configuration and causes Buster to crash.
- Creating hash file names using [file name].[hash].[file ext] can potentially cause buster to hash the file name twice
- Remove find-in-file from project and update package dependencies to remove security warnings
- Reduce console.log output to the minimum required
- Refactor code base to only support cache busting in place.
- File names that overlap with other filenames are hashed twice.
- replacement operation doesn't work as expected HOT 1
- Correct any issues that updating all dependencies to latest may have raised.
- Generate unique hashes for all files that do not have content.
- Create a hashing algorithm to replace the reliance on md5-file. It should take a string and return a hash.
- Update README.txt.
- v0.1.6 breaks handling of backup files i.e. filename.buster-copy.ext
- Safe Mode
- When resolving configuration, try paramsConfig first
- Why does cache busting my map file mangle the sourceMappingURL
- Restore is failing sometimes due to v0.2.0's Phantom File fix
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from buster.