Giter Club home page Giter Club logo

assetgen's People

Contributors

aadis avatar augusto-herrmann avatar dobesv avatar markchadwick avatar micrypt avatar runeh avatar tav avatar thruflo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

assetgen's Issues

Exception when output.hashed is false

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!

Feature: Tweak url references in CSS with a hash

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.

`self.manifest_force` defaults to `True`.

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.

Inserting a string from external file inside a generated js file brings an undesired newline

Description

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.

How to reproduce

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. ");").

Cannot use embed() in scss files

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().

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.