Code Monkey home page Code Monkey logo

Comments (6)

jbrantly avatar jbrantly commented on May 11, 2024 1

Thanks for the gist, that's always helpful. I'll take a look and get back to you.

On a quick glance I'm wondering if the slash in "exclude": ["node_modules/"] is affecting it? That's purely a guess and I haven't tried it but might be worth a quick shot to remove the slash.

from ts-loader.

jbrantly avatar jbrantly commented on May 11, 2024

The exclude option is already supported since that functionality is delegated to TypeScript. Keep in mind that the exclude option only functions if you are not specifying a files property and it only affects the initial list of files to load. It does not "ban" files from being included in the program through other means like import or tripleslash references. I just ran some quick tests and the loader seems to work identically to tsc. If you have a scenario where it doesn't please let me know.

If I get this right, this plugin just goes for the "files" option in the tsconfig, else loads all files (regardless of webpack configuration).

Not quite. The webpack entry points are definitely where things "start". However, any additional files specified in tsconfig.json are also loaded into the program. Note that this does not mean they'll necessarily be emitted since webpack controls what is and isn't emitted based on the dependency tree starting at the entry point. In other words you could specifically include some file, say b.ts, using tsconfig.json but if your entry point nor any of its dependencies actually import it then it won't be emitted into the webpack bundle.

from ts-loader.

jbrantly avatar jbrantly commented on May 11, 2024

Going to close this since I don't think there's an actual issue but feel free to reopen if that's incorrect.

from ts-loader.

sateffen avatar sateffen commented on May 11, 2024

I've created an Gist with this problem: https://gist.github.com/sateffen/bfbafa46b181098c9eee

Every grunt build or grunt test will complain about files in the node_modules folder, even though I excluded it in tsconfig.json and the configurations.

Maybe I'm doing something else wrong, but when putting only the files to include in the tsconfig.json, everything works fine.

Do you have any idea?

from ts-loader.

sateffen avatar sateffen commented on May 11, 2024

Wow, this actually works.

So my problem all the time was, that the slash was there. Without slash everything works fine. That is good to know.

Ok, so the problem was me, not your loader. Big thanks, and sorry for the report!

from ts-loader.

jbrantly avatar jbrantly commented on May 11, 2024

No worries, these things happen 😄

from ts-loader.

Related Issues (20)

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.