Skip to content
This repository was archived by the owner on Feb 27, 2019. It is now read-only.
This repository was archived by the owner on Feb 27, 2019. It is now read-only.

Webpack watch performance #211

@FlorianChauvel

Description

@FlorianChauvel

Hi, I'm using the current config :

Angular2
Webpack
Typescript
Less

In local dev mode (npm run serve), the watch task takes around 30sec. It seems to be caused by this part of the webpack config :

           {
               test: /\.(css|less)$/,
               loaders: [
                   'style-loader',
                   'css-loader',
                   'less-loader',
                   'postcss-loader'
               ]
           }

Effectively, 'less-loader' is applied to any css file which drastically impacts the performances. I managed to reduce the watch task to ~500ms by splitting the webpack loaders this way :

            {
                test: /\.(css)$/,
                loaders: [
                    'style-loader',
                    'css-loader',
                    'postcss-loader'
                ]
            },
            {
                test: /\.(less)$/,
                loaders: [
                    'style-loader',
                    'css-loader',
                    'less-loader',
                    'postcss-loader'
                ]
            }

However, I don't know how to fix the generator itself. Hope someone more experienced could pick this up and provide a pull request.

Metadata

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