I was trying to use this loader in a project that uses Webpack 4 and Babel 7, and webpack would fail because the sourcemap wasn't in the expected format:
Syntax Error: Error: .inputSourceMap must be a boolean, object, or undefined
After some debugging I found that the sourcemap was coming in as a string (JSON encoded string) in this case, which Babel doesn't allow. I've added detection for this, and then JSON decode the string if it's a string.
I had to modify the tests slightly because on my mac the expected was coming back with \r\n line endings in the built code, but just in the typescript test case. I tried modifying typescript to use the LF line ending (via tsconfig.json setting) but that had no effect with awesome-typescript-loader. I tried changing to ts-loader, which does seem to obey the newLine setting, but that opens a whole different can of worms that I didn't want to get into for this (output differed quite a bit with ts-loader, mainly in how it defined the module).
Removed some really old versions of Node from travis.yml as they couldn't even run yarn. Added more up-to-date versions.
I was trying to use this loader in a project that uses Webpack 4 and Babel 7, and webpack would fail because the sourcemap wasn't in the expected format:
(It appears that this is thrown in Babel, here: https://github.com/babel/babel/blob/master/packages/babel-core/src/config/validation/option-assertions.js#L157)
After some debugging I found that the sourcemap was coming in as a string (JSON encoded string) in this case, which Babel doesn't allow. I've added detection for this, and then JSON decode the string if it's a string.
I had to modify the tests slightly because on my mac the expected was coming back with
\r\n
line endings in the built code, but just in thetypescript
test case. I tried modifying typescript to use the LF line ending (viatsconfig.json
setting) but that had no effect withawesome-typescript-loader
. I tried changing tots-loader
, which does seem to obey thenewLine
setting, but that opens a whole different can of worms that I didn't want to get into for this (output differed quite a bit withts-loader
, mainly in how it defined the module).Removed some really old versions of Node from
travis.yml
as they couldn't even runyarn
. Added more up-to-date versions.