Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Juho Vepsäläinen
    @bebraw
    have you thought about tracking timing? i know webpack gives some output at cli
    Owais Lone
    @owais
    time as in when the event occurred or how much time it took to build the bundle?
    Juho Vepsäläinen
    @bebraw
    latter though i suppose former wouldn't hurt since it's probably free to add
    just started thinking how other tools could hook into the data. it would be possible to get some nice stats (-> graphs?) from CI and so on
    errors -> show exact point of error at ide/editor
    i've been thinking of doing a little tool to point out common configuration issues btw
    Owais Lone
    @owais
    Hmm. Yes, that would be cool. It could also support multiple channels. Instead of emitting to a file, it could store data in Redis for example.
    I'll come back to this in a few hours and see if I can add additional data.
    Juho Vepsäläinen
    @bebraw
    it might be good if the emit mechanism was generic. keeps your library simple
    ok, cool
    i'll write a little spec for my tool so you can understand the idea better
    debugging/dealing with errors is one of the difficult parts of webpack
    Owais Lone
    @owais
    It sure is :)
    Juho Vepsäläinen
    @bebraw
    here's the initial spec i had in mind https://github.com/survivejs/webpack-doctor/issues
    Andrew Chen
    @ayc92
    @owais: When you get a chance, could you take a look at this PR? It has to do with appending to the stats file rather than overwriting what was already in it.
    Juho Vepsäläinen
    @bebraw
    @owais about webpack-doctor, https://github.com/js-dxtools/webpack-validator is achieving the vision :)
    @owais there's also https://github.com/js-dxtools/webpack-build-analyzer . more in a stub stage right now
    Eitan R
    @erosenberg
    @owais - Hey! I've been following your tutorial and cannot get webpack-bundle-tracker to see that I'm compiling a CSS bundle separately. Is this a common issue?
    Owais Lone
    @owais
    Not that I'm aware of, could you share your webpack config and bundle tracker output?
    Eitan R
    @erosenberg
    hey! sure thing
    is there a good way to format them in Gitter?
    I apologize for not sharing the files - they're hosted on an enterprise server and contain some sensitive info but I'll share what I can
    var webpack = require('webpack');
    var path = require("path");
    var ExtractTextPlugin = require("extract-text-webpack-plugin");
    var BundleTracker = require('webpack-bundle-tracker');
    
    var BASE = __dirname;
    
    module.exports = {
        entry: {
          app: [BASE + '/js/index.js']
        },
        output: {
            path: BASE + '/../static/compiled/',
            filename: "[name]-[hash].js"
        },
        plugins: [
            new BundleTracker({filename: './webpack-stats.json'}),        
            new ExtractTextPlugin('stylez.css', { allChunks: true })
        ],
        module: {
            noParse: /vendor/,
            loaders: [
                {
                    test: /\.js?$/,
                    loaders: ['babel-loader']
                },
                {
                    test: /\.(less|css)?$/,
                    loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader")
                },
                {
                    test: /\.json$/,
                    loader: "json"
                },
                {
                    test: /\.csv$/,
                    loader: "dsv-loader"
                },
                {
                    test: /\.(png|jpg|jpeg|gif)/,
                    loader: 'file-loader'
                }
            ]
        }
    };
    here's my webpack-stats.json:
    {
        "status": "done",
        "chunks": {
            "app": [{
                "name": "bundle.js",
                "path": "/Users/eitan/Sites/myApp/static/compiled/bundle.js"
            }]
        }
    }
    STATIC_URL = '/static/'
    STATIC_ROOT = os.path.join(BASE_DIR, 'static/compiled/')
    
    WEBPACK_LOADER = {
        'DEFAULT': {
            'BUNDLE_DIR_NAME': 'compiled/',
            'STATS_FILE': os.path.join(BASE_DIR, 'frontend/webpack-stats.json')
        }
    }
    @owais ^
    Eitan R
    @erosenberg
    one of the main reasons things aren't working is also the webpack-stats.json doesn't seem to update or regenerate ever...
    Here's my template: