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

Webpack watch performance #211

Open
FlorianChauvel opened this issue Aug 2, 2017 · 1 comment
Open

Webpack watch performance #211

FlorianChauvel opened this issue Aug 2, 2017 · 1 comment

Comments

@FlorianChauvel
Copy link

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.

@martinchristov
Copy link

+1 I'm having the same issue, but I use sass-loader instead. It's taking a similar amount of time to reload the style :( We really need a solution for this

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants