Giter Club home page Giter Club logo

Comments (7)

blikblum avatar blikblum commented on June 16, 2024

Same thing here.
The less-loader/css-loader output is effectively stripped from bundle by the ExtractTextPlugin

But stats.json still show them. Maybe an issue in the generation of json output? (i.e., using --json argument)

An possible workaround is to check the issuer field since it has the following pattern when is extracted from bundle:

\\node_modules\\extract-text-webpack-plugin\\loader.js?{\"remove\":true}

from webpack-visualizer.

motin avatar motin commented on June 16, 2024

@chrisbateman It seems less-loader is still affected (not seeing css-loader though) https://www.dropbox.com/s/9on4hjfafdjy9zv/Screenshot%202017-01-09%2014.40.25.png?dl=0
Using v 0.1.7 which was released 15 hours ago.

from webpack-visualizer.

chrisbateman avatar chrisbateman commented on June 16, 2024

@motin So right now I believe we're only removing CSS if it uses the ExtractTextPlugin - which moves the CSS to a separate file. Otherwise, the CSS is still included in your JS bundle.

from webpack-visualizer.

motin avatar motin commented on June 16, 2024

@chrisbateman ExtractTextPlugin is used in our config, and the CSS is placed in a separate file because of to that. The screenshot however shows that "less-loader" still is included, even though it is only a dev-dependency in our project.

from webpack-visualizer.

chrisbateman avatar chrisbateman commented on June 16, 2024

@motin Hmm, I don't think I'm seeing that in my test app.

Any chance you could share your loader config and maybe even your stats.json?

from webpack-visualizer.

blikblum avatar blikblum commented on June 16, 2024

I analyzed the stats of one of my projects, see below

Stats: https://1drv.ms/u/s!AhehaflTFeyS9CR_UiVT6Z7CVxaG
https://github.com/blikblum/marionette-wires-revisited/blob/master/src/main.js

All css is required by 'main.less' and extracted into a separate file (checked the actual bundle to make sure).

Tracking main.less entries in stats log i got the following:

  • main.less entry as id 212 with name as "./src/main.less"
    extract-text-plugin is in identifier path, but NOT in issuer
    index !== null
    "chunks": [0]

  • second main.less entry as id 213 with name as ".//css-loader!.//less-loader!./src/main.less"
    extract-text-plugin is NOT in identifier path, but is in issuer
    index !== null
    "chunks": []

later comes all *.less files required by main.less, the first being wells.less with the following pattern

  • name: "./~ /less-loader/stringify.loader.js!./~/bootstrap/less/[name of the less file]"
    extract-text-plugin is NOT in identifier path and is NOT in issuer
    index: null
    "chunks": []

With this i modified the buildHierarchy to account these situations. Will do a PR to be reviewed

from webpack-visualizer.

chrisbateman avatar chrisbateman commented on June 16, 2024

@blikblum Awesome. I think it maybe it wasn't showing up in my example since none of my less files were in the node_modules. Thanks very much!

from webpack-visualizer.

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.