Code Monkey home page Code Monkey logo

Comments (5)

TobiasKrogh avatar TobiasKrogh commented on July 29, 2024 7

@JustSayNO I looked up the mentioned starter kit and it would seem they already do such excludes for node_modules in webpack.common.js (which is merged into webpack.dev.js) and webpack.test.js

Example from webpack.common.js

      {
        test: /\.js$/,
        loader: 'source-map-loader',
        exclude: [
          // these packages have problems with their sourcemaps
          helpers.root('node_modules/rxjs'),
          helpers.root('node_modules/@angular'),
        ]
      }

You should be able to add one entry in the exclude array like helpers.root('node_modules/ng2-redux'). I shortly tested that and I do not see any warnings. Same applies of course to the webpack.test.js.

Webpack seems to recommend using the include over the exclude when possible (see Example in https://webpack.github.io/docs/configuration.html#module-loaders). In general the include / exclude works by passing one condition or an array of conditions which in turn can be path references or regular expressions.

Hope this helps.

from store.

e-schultz avatar e-schultz commented on July 29, 2024

@TobiasKrogh thanks for letting us know. Wondering if including the src with the npm package might be useful though for development/debugging purposes.

from store.

TobiasKrogh avatar TobiasKrogh commented on July 29, 2024

@e-schultz I basically just followed the default configuration for the source-map-loader. I am fairly new to webpack, angular2 and ng2-redux. Just wondered about the warnings. However excluding ng2-redux from this loader works fine from my point of view. Just wanted to let you know in case this has some other implications or others stumble upon it.

from store.

sethreidnz avatar sethreidnz commented on July 29, 2024

How does one get rid of these warning when using cheap-module-source-map?

I have been using the config in this starter kit

And adding the above mentioned to the config/webpack.common.js doesn't do the trick. There is also the config/webpack.dev.js that uses the cheap-module-source-map option.. I can't find anywhere how you are supposed to exclude files this way..

These warnings are fine but then if I pass it onto another dev they might get worried!

from store.

sethreidnz avatar sethreidnz commented on July 29, 2024

Yeah I tried adding that line before I made my post.. I'm not sure why its not effecting the output tbh. My loader for that looks like this:

{
  test: /\.js$/,
  loader: 'source-map-loader',
  exclude: [
    // these packages have problems with their sourcemaps
    helpers.root('node_modules/rxjs'),
    helpers.root('node_modules/@angular'),
    helpers.root('node_modules/ng2-redux')
  ]
}

from store.

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.