ts-loader

Webpack regex test that matches *.ts but not *.d.ts

旧街凉风 提交于 2019-12-02 05:51:20
问题 I am using Webpack (2.3.3) to build my Aurelia app in TS. However, since I am using includeAll option for AureliaPlugin (2.0.0-rc.2), ts-loader (2.0.3) cries about d.ts files that has nothing exported emitting no output. here is my rule for ts files: { test: /\.ts$/, include: /ClientApp/, use: "ts-loader" } I need to change the test value in a way that it matches files named *.ts except *.d.ts. Can you help me please? Note: I see there is already a similar regex question but that one did not

Webpack cant resolve TypeScript modules

余生颓废 提交于 2019-11-30 04:33:16
I build a relay small webpack and typescript demo to play with. If i run webpack with the webpack.config.js i get this error: ERROR in ./js/app.ts Module not found: Error: Can't resolve './MyModule' in '/Users/timo/Documents/Dev/Web/02_Tests/webpack_test/js' @ ./js/app.ts 3:17-38 I have no clue what the problem could be. The module export should be correct. Folder Structure webpack.config.js const path = require('path'); module.exports = { entry: './js/app.ts', output: { path: path.resolve(__dirname, 'dist'), filename: 'bundle.js' }, module: { rules: [ {test: /\.ts$/, use: 'ts-loader'} ] } };