Upgrading from Typescript from 2.0.10 to 2.1.4, it looks like something broke in webpack, webpack-stream, ts-loader or gulp, as it no longer takes into account my entry point or gulp source glob. Apparently, it includes all the .ts files in my project (including the source folder / server), and not just the ts files in / client and app.ts according to the entry point of gulp.src and the web package . Is there any other / newer / better way that I should do this?
in the gulp file:
const serverPath = 'server'; const clientPath = 'client'; const buildPath = 'build'; const paths = { server: { scripts: [ `${serverPath}/**/*.ts` ] }, client: { files: [ `${clientPath}/**/*` ], scripts: [ `${clientPath}/**/*.ts` ], entry: `${clientPath}/app.ts` } }; gulp.task('build:client', cb => { gulp.src(paths.client.entry) .pipe(webpackStream(webpackConfig, webpack)) .pipe(gulp.dest(`${buildPath}/${clientPath}`)); cb(); });
in web package configuration:
entry: { app: './client/app.ts' } ts: { configFileName: './tsconfig.json' } resolve: { extensions: ['', '.webpack.js', '.web.js', '.ts', '.tsx', '.js'] } module: { loaders: [ { test: /\.ts$/, loader: 'ng-annotate-loader!ts-loader' } ] }
in tsconfig.json:
{ "compilerOptions": { "module": "commonjs", "target": "es6", "removeComments": false, "noImplicitAny": true, "sourceMap": true, "inlineSources": true, "experimentalDecorators": true, "emitDecoratorMetadata": true } }
Exit using 2.0.10:
ts-loader: Using typescript@2.0.10 and /Users/chris/code/class-app/tsconfig.json [20:47:36] Version: webpack 1.14.0 Asset Size Chunks Chunk Names app.js.map 950 bytes 0 [emitted] app app.js 550 bytes 0 [emitted] app
Exit using 2.1.4:
ts-loader: Using typescript@2.1.4 and /Users/chris/code/class-app/tsconfig.json server/api/thing/thing.controller.ts(17,16): error TS2322: <ts error in server portion, not relevant> [20:53:03] TypeScript: 1 semantic error [20:53:03] TypeScript: emit succeeded (with errors) Unhandled rejection Error in plugin 'webpack-stream' Message: /Users/chris/code/class-app/server/api/thing/thing.controller.ts <same as above>