Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Horrible webpack performance (8x) when ExtractTextPlugin is present #144

Closed
@medeeiros

Description

I've tried many things already, and I can't get rid of the performance issues when using the ExtractTextPlugin.

This is my stats.json file WITH ExtractTextPlugin
stats.json.zip
And the configuration looks something like:

module.exports = {
    name: 'mycujoo-client',
    target: 'web',
    entry: './statics/mycujoo-app/index.js',

    output: {
        path: path.resolve('./dist/client'),
        filename: '[name].bundle.[hash].js',
        publicPath: '/dist/client/'
    },

    module: {
        loaders: [
            loaders.js,
            loaders.cssFile
        ].concat(commonLoaders)
    },

    plugins: [
        new ExtractTextPlugin('[name].bundle.[hash].css', { allChunks: true }),
        new AssetsPlugin({ path: path.join(__dirname, '..', 'dist') }),
        new webpack.optimize.OccurenceOrderPlugin(),
        new webpack.NoErrorsPlugin(),
        new webpack.DefinePlugin({
            'process.env': JSON.stringify(process.env)
        })
    ],

    resolve: { alias: alias },

    postcss: postcss
}

and my stats WITHOUT ExtractTextPlugin
stats.json.zip

module.exports = {
    name: 'mycujoo-client',
    target: 'web',
    entry: './statics/mycujoo-app/index.js',

    output: {
        path: path.resolve('./dist/client'),
        filename: '[name].bundle.[hash].js',
        publicPath: '/dist/client/'
    },

    module: {
        loaders: [
            loaders.js,
-           loaders.cssFile
+           loaders.cssInline
        ].concat(commonLoaders)
    },

    plugins: [
-       new ExtractTextPlugin('[name].bundle.[hash].css', { allChunks: true }),
        new AssetsPlugin({ path: path.join(__dirname, '..', 'dist') }),
        new webpack.optimize.OccurenceOrderPlugin(),
        new webpack.NoErrorsPlugin(),
        new webpack.DefinePlugin({
            'process.env': JSON.stringify(process.env)
        })
    ],

    resolve: { alias: alias },

    postcss: postcss
}

where

cssInline:  { test: /\.css$/, loader: 'style-loader!css-loader?sourceMap&modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader' },
cssFile:    { test: /\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!postcss-loader') },

Because I'm generating two bundles, the performance is twice as bad.
I really don't know what to do.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions