Code Monkey home page Code Monkey logo

import-glob's People

Contributors

jmarceli avatar mathiasarmstrong avatar terpiljenya 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

Watchers

 avatar  avatar

import-glob's Issues

is it possible to look at webpack resolve.root for additional load paths?

my app's root is set like this

  config.resolve = {
    root: path.resolve(__dirname, '../app')
  };

so that if i am importing a file at app/img/foo.png, i can say

import 'img/foo.png'

instead of '../../img/foo.png' or whatever

Is it possible to use the webpack resolution roots to look for files to glob?

Problem with import pug-template

Hello! Nice work, but I have problem with import pug-template.

I used
"import "./**/*.pug"
in my entry point and ive got error after start webpack

Module not found: Error: Cannot resolve 'file' or 'directory' ./**/*.pug in {my_frontend_directory}

Where am I wrong?

Non-matching globs don't generate any code

If the glob pattern matches no filenames, the loader returns an empty string. It should probably return an empty array, so that code like this:

import foo from './*.bar';
console.log(foo);

Doesn't result in "foo is not defined"

Watching glob pattern for file additions

Sweet plugin! Small issue with it though = if you add/remove a file in the glob pattern webpack doesn't pick up the changes until you completely restart.

Is there a way to watch the folder and re-compile?

No option for ignore directories

Node's glob package has an option nodir (https://github.com/isaacs/node-glob#options) that would have value here.

Suppose I have main.ts:

import './app/**/*.module'

Notice that I omitted the file extension. This should grab all module files first and process them. However, the glob use in this project doesn't seem to have an option for ignoring directories. That means, for example, if I'm using the TypeScript loader, I get 'failed to find' errors - because glob returns directories, and awesome-typescript-loader can't parse a directory.

To fix, I have to

import './app/**/*(.js|.ts)'

Which is tolerable, but also defeats the value of webpack - suck up everything and process via the appropriate loader.

Please advise/weigh in.

Does not support aliases

works

import foo from '../../../js/foo/*';
console.log(foo);

doesnt work

import foo from 'foo/*';
console.log(foo);

the alias is added in webpack properly.

Is it possible to introduce error handling for multiple imports

Is it possible to introduce error handling for multiple imports when either the path or the match criteria is wrong. Presently it throws

TS2304: Cannot find name
error when the import fails for e.g.

import modules from './wrongpath/**/wrongMatch.**';

and the modules variable disappears and cannot be debugged.

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.