tav / assetgen Goto Github PK
View Code? Open in Web Editor NEWAsset generator for modern web app development
License: Other
Asset generator for modern web app development
License: Other
Currently using embed() in scss files results in processing error. It looks like the scss file has to be processed before passing it to sass or it'll reject the embed().
If output.hashed is set to false, output_path will be set to None on line 1017 in main.py. This will cause the join operations with output_path to fail.
Thanks!
It would be nice if the CSS files could have (some of) their url references changed to add a file hash to the URL. This would allow us to add a rule to nginx to use a long expiry time on the URLs that have a hash in them.
It could find URLs in the same way as embed, but instead of changing the URL to a data URL it would adjust the URL to insert the file hash into the URL, possibly using some sort of path template.
We're trying to build a js file that has a string whose content comes from another external file (e.g. for inserting css styles dynamically into the DOM). The problem is, in Javascript, strings must be contained in a single line, and when assetgen imports the file, a newline gets added at the end.
Take any file (in this example, assets/single-line.css) that has a single line (contains no newlines) in it. Use the following yaml configuration file to generate a new .js file (in this case, runtime-styles.js). For the record, we're using Linux (in case the newline stuff makes any difference).
# newline-bug.yaml:
generate:
- runtime-styles.js:
source:
- raw: "insert_css('"
- assets/single-line.css
- raw: "');" # closing function
compress: false
js.uglify.bin: uglifyjs
output.directory: build
output.hashed: false
The generated runtime-styles.js file will have to lines. An unwanted newline will appear before the closing part (i.e. ");"
).
Having updated to version 0.3
, I found my AssetGenRunner instance was outputting a new manifest every second, because the self.manifest_force
was True, despite not setting output.manifest.force
or using the --force
flag.
For reference, my relevant yaml config was:
output.directory: ../var/assets
output.hashed: true
output.manifest: ../var/assets/assets.json
profile.dev:
output.hashed: false
css.compress: false
js.compress: false
My command was:
assetgen: assetgen --profile dev --watch
Adding this line to the config solved the issue:
output.manifest.force: false
But this should presumably default to false, as the --force
flag is set to store true only if provided. Logging the following above line 680 in AssetGenRunner.init:
log.info((config.pop('output.manifest.force', False), force))
Gave me (True, None)
so presumably its an issue with the config.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.