* @param {object} [options] See https://github.com/s-panferov/awesome-typescript-loader#loader-options * @return {Function}
(options = {})
| 13 | * @return {Function} |
| 14 | */ |
| 15 | function typescript(options = {}) { |
| 16 | return (context, util) => |
| 17 | util.merge({ |
| 18 | resolve: { |
| 19 | extensions: ['.ts', '.tsx'] |
| 20 | }, |
| 21 | module: { |
| 22 | rules: [ |
| 23 | Object.assign( |
| 24 | { |
| 25 | test: /\.(ts|tsx)$/, |
| 26 | use: [ |
| 27 | { |
| 28 | loader: 'awesome-typescript-loader', |
| 29 | options |
| 30 | } |
| 31 | ] |
| 32 | }, |
| 33 | context.match |
| 34 | ) |
| 35 | ] |
| 36 | }, |
| 37 | plugins: [ |
| 38 | new CheckerPlugin(), |
| 39 | new TsConfigPathsPlugin({ tsconfig: options.configFileName, compiler: options.compiler }) // This hooks into webpacks module resolution, configure via tsconfig.json |
| 40 | ] |
| 41 | }) |
| 42 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…