-
Notifications
You must be signed in to change notification settings - Fork 125
Cannot use happypack in a chain with other loader. #32
Comments
Hmm, yeah that is reasonable because up until now we assume happypack is running as the fore-most loader (it can chain up to other loaders but not the other way around, which is more complicated when pitch loaders are in play.) Is there any reason you don't want to use |
Hmm, seems that I have missed something, but you have said that ts-loader is not supported because loader uses private |
Oh, I'm sorry. I mixed those up. You're totally right, only the linter is supported. I'll take a look at this when I have the time. Did you try using |
Omg, no:-) How it could works? Seems that happypack works only with file, stored on disk, not with a string, passed from another loader. Did webpack preLoader rewrites file? |
Just tried this config:
same error: hapypack starts on non-transpiled tsx file |
No no :) it wouldn't make sense for it to work currently, but I'm wondering if that's the way to go. We can make HappyPack skip reading the source from disk using some flag (that is, also skip the pitching phase, because webpack doesn't read the source until the pitching phase is done). We would use that flag in such cases where we know there are no pitching loaders - The config would be something like: module: {
loaders: [{
test: /\.tsx?$/,
loaders: [ 'happypack/loader?id=babel', 'tslint', 'ts' ]
}]
},
plugins: [
new HappyPack({
id: 'babel',
readSourceFromDisk: false // or something
}]
] This way, HappyPack would use a temp file to store the initial contents and read that temp file instead of the source file in its background processes (because I don't think it's a good idea to send such big blobs across the process sockets.) |
Maybe there is any way to check that happypack's loader is the loader first in a chain? |
What's the status on this? I believe HappyPack has started accepting the source from the loader chain instead of disk since a7c4dff - is this still valid? |
Closing as I believe this was fixed. For ts-loader support we have a different thread. |
Trying yo implement this:
causes to call babel on non-transpiled typescript file.
The text was updated successfully, but these errors were encountered: