-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve initial build times using happypack #1090
base: master
Are you sure you want to change the base?
Conversation
I would also suggest using |
looks good, json files broken tho. |
Happypack is awesome! My only concern is sourcemaps. |
@igoldny will take a look, created a ticket for it: amireh/happypack#30 @mmahalwy I've a ticket (amireh/happypack#28) open for source-map support, just need to find some time to tackle it. |
@amireh does this PR need to be updated given that source-map support is there now? |
Enables parallel loader application for jsx, json, sass, and less sources using five background threads. Some env notes: - you can disable HappyPack entirely by setting HAPPY=0 in your env - you can disable HappyPack's caching by setting HAPPY_CACHE=0 - you can make HappyPack more verbose by setting HAPPY_VERBOSE=1 (useful to see the state of cache) - HappyPack's state and cache can be reset by `rm -r .happypack/` Other minor changes: - made those loaders only apply to files under `/src` (a whitelist)
a0daa6b
to
879139a
Compare
@oyeanuj Yes, just did the upgrade and re-tested. I also went over the reported json-loader issue and was not able to reproduce, there's now an example/test for json-loader and it seems to function correctly. |
@amireh Thanks for the update. I was trying it out and the only issue I ran into was when I was trying to expand it to include css (instead of sass). Following exactly how 'sass' loader was configured, I got the following errors. Any thoughts on this? Let me know if I should move this conversation to the happypack repo instead?
In module.exports: createSourceLoader({
happy: { id: 'sass' },
test: /\.scss$/,
loader: 'style!css?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded&sourceMap',
}),
createSourceLoader({
happy: { id: 'css '},
test: /\.css$/,
loader: 'style!css?importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]'
}), In plugins array:
|
Actually, ignore my question above. Once I changed |
{ test: /\.json$/, loader: 'json-loader' }, | ||
{ test: /\.less$/, loader: 'style!css?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!autoprefixer?browsers=last 2 version!less?outputStyle=expanded&sourceMap' }, | ||
{ test: /\.scss$/, loader: 'style!css?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!autoprefixer?browsers=last 2 version!sass?outputStyle=expanded&sourceMap' }, | ||
{ test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, loader: "url?limit=10000&mimetype=application/font-woff" }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this one was completely removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No woff
and woff2
are replaced by the woff2?
regex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I missed that! :)
Enables parallel loader application for jsx, json, sass, and less
sources using five background threads.
Some env notes:
to see the state of cache)
rm -r .happypack/
Other minor changes:
/src
(a whitelist)