我想导入一些扩展名特定的文件。
源代码:
index.ts:
import Hello from "./a.xx";
以下是配置文件:
webpack.config.js:
// ...
module: {
rules [{
test: /(?:\.ts|\.xx)$/,
use: "awesome-typescript-loader"
}]
}
// ...
tsconfig.json:
{
"compilerOptions": {
"module": "commonjs",
"sourceMap": true
},
"include": [
"*.ts",
"*.xx"
]
}
有一些错误:
webpack:
Module build failed: Error: Final loader (./node_modules/awesome-typescript-loader/dist/entry.js) didn't return a Buffer or String
awesome-typescript-loader:
Child process failed to process the request: TypeError: Cannot read property 'moduleAugmentations' of undefined