I don't know that this issue is directly related to ATL, but when I use ATL and declaration: true
tsconfig settings, interfaces are ignored and not generated in d.ts files unless a class implements that interface from within the same file (even if other files have classes which implement the interface).
for example:
// src/shape.ts
export interface Shape {
getArea(): number;
}
export class Circle implements Shape {
getArea() {
throw 'no';
}
}
in the case above, src/shape.d.ts
will be created and will contain an interface declaration for Shape.
// src/shape.ts
export interface Shape {
getArea(): number;
}
// src/shapes/circle.ts
import { Shape } from '../shape.ts';
export class Circle implements Shape {
getArea() {
throw 'no';
}
}
In this case, shape.d.ts
is never generated, but circle still references it, so I get errors when using the bundle from another project.
Any thoughts? Again, might not be ATL.
[at-loader] Using typescript@2.4.1 from typescript and "tsconfig.json" from /home/rjansen/CODE/core/tsconfig.json.
[at-loader] ./src/math.ts:1:18
TS2304: Cannot find name '__webpack_public_path__'.
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"moduleResolution": "node",
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true,
"rootDir": "./src",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"typeRoots": [
"./node_modules/@types"
],
"types": [
"jasmine",
"node",
"core-js",
"protractor"
],
"baseUrl": "./src",
"paths": {
"*": ["../node_modules/*", "*"]
}
},
"exclude": [
"node_modules"
],
"awesomeTypescriptLoaderOptions": {
"silent": true
}
}
rootDir: './'
might help. But am not really sure!
awesome-typescript-loader@4.0.0-0 postinstall C:\01.Projects\01.Common\01.GIT\acr\node_modules\awesome-typescript-loader
node node_modules/husky/bin/install.js || true
module.js:540
throw err;
^
Error: Cannot find module 'C:\01.Projects\01.Common\01.GIT\acr\node_modules\awesome-typescript-loader\node_modules\husky\bin\install.js'
"awesomeTypescriptLoaderOptions": {
"skipDeclarationFilesCheck ": true,
"transpileOnly": true
},
Hello, I enabled the useBabel property because there is a node module that I'm using that is using the spread operator and one of the browsers that I'm trying to support is edge and edge doesn't have support for object spread operator.
This means the spread operator in that module needs to be transpile to use object.assign. I've tried using the exclude and include property of the loader in so many different ways but none of them have helped.
I don't know if it's babel that is the issue or if it's awesome-typescript-loader. I'm using a preset called babel edge that uses @babel/preset-env, babel/plugin-proposal-object-rest-spread and many more plugins built in this preset.
Here is my webpack.config.js(simplified to only show the loaders)
{
{
test: /\.js$/,
use: [{ loader: 'source-map-loader' }],
enforce: 'pre',
exclude: /node_modules/
},
{
test: /\.tsx?$/,
use: [
{
options: {
useTranspileModule: true,
forceIsolatedModules: true,
useCache: true,
useBabel: true,
babelOptions: {
babelrc: false /* Important line */,
presets: [['edge', { transpile: 'modern', modules: false }]]
},
reportFiles: ['src/**/*.{ts,tsx}'],
babelCore: '@babel/core'
},
loader: 'awesome-typescript-loader'
}
],
include: [path.resolve(__dirname, 'src'), path.resolve(__dirname, 'node_modules', '@furystack', 'inject')]
},
}
What am I doing wrong?