Giter Club home page Giter Club logo

file-deps's People

Contributors

jasonkuhrt avatar matthewmueller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

file-deps's Issues

A duplicate edge-case

I thought of this while working on the PR to prune dupes: #6

Currently these are considered different:

.a { background-image: url('z.png'); }
.b { background-image: url("./z.png"); }

It seems to me they should not be. Agreed?

0.0.8 breaks duo

Hey @matthewmueller, I tried to upgrade to [email protected] in duo, but it breaks a lot of functionality. Namely, #7 has caused duo to not rewrite things like @import "./one.css"; since the ./ is being stripped.

The mapping going to duo-pack basically looks like:

{ 'index.css':
   { id: 'index.css',
     type: 'css',
     mtime: 1431373205000,
     src: '@import "./one.css";\n\n.index {\n  color: white;\n}\n',
     deps: { 'one.css': 'one.css' },
     entry: true },
  'one.css':
   { id: 'one.css',
     type: 'css',
     mtime: 1417547024000,
     src: '.one {\n  color: green;\n}\n\n@import \'./two.css\';\n',
     deps: { 'two.css': 'two.css' } },
  'two.css':
   { id: 'two.css',
     type: 'css',
     mtime: 1417547024000,
     src: '.two {\n  color: red;\n}\n',
     deps: {} } }

The deps are now different, so duo-pack is not resolving them correctly.

Should this result in a change to duo-pack? Or is this a regression?

How to handle the font fix

I was looking into fixing duojs/duo#438, and I ended up stopping at this lib once I noticed you are intentionally stripping the query/hash portion of the URL.

I'm curious why that's necessary? Is it just to prevent downloading the same file twice?

Duplicate file paths edge-case #2

@matthewmueller This is currently impossible to catch:

.a { background-image: url('z.png'); }
.b { background-image: url("../fixtures/z.png"); }

The reason it is impossible to catch is that we don't have any information about the path of the str coming in here: https://github.com/MatthewMueller/file-deps/blob/master/lib/css.js#L33

What I would like to suggest/brain-storm is a minimal API change that would provide the path of given str so that we can rule out dupes more robustly.

Custom type support

It would be awesome if this lib would allow custom types to be registered from the outside, this would be a great first-step to solving duojs/duo#171

var filedeps = require("file-deps");

filedeps.type('html', function (str, ext, fn) {
  // custom type handler
});

Does not recognize multiple background-images properly

When using multiple backgrounds, this module does not parse url() declarations after the first one properly:

a {
  background-image: url('./logo.png'), url('./caret.png');
}

The first one (./logo.png) gets parsed correctly, but the 2nd (./caret.png) is not detected. (and is not rewritten by the consumer)

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.