Questions tagged [awesome-typescript-loader]

15 questions
13
votes
2 answers

Sharing code between projects using TypeScript and webpack

I want to share code between two TypeScript projects. I don't want to publish shared code to NPM-- just want to put shared code in one project and use it in another project. I'm using Webpack and awesome-ts-loader. Current folder structure…
Justin Grant
  • 41,265
  • 11
  • 110
  • 185
8
votes
1 answer

awesome-typescript-loader does not pick up changes in JSON

Assume I have some JSON file (let's name it template.json) { "myField1": "", "myField2": "" } I also have a kind of generic class export default GenericClass { // Creating an empty constuctor with passed type. // to allow define…
3
votes
0 answers

How do i overwrite the typescript loader in Angular 6/7?

I am trying to implement a custom webpack configuration for my Angular 7 application that overwrites the typescript loader so i can use a customerTransformer (see ts-loader/getCustomTransformer or awesome-typescript-loader/getCustomTransformer) in…
2
votes
1 answer

Transform typescript before typecheck

Let's take typescript file: class A { private x? = 0; private y? = 0; f() { console.log(this.x, this.y); delete this.x; } } const a = new A(); a.f(); I'm building it in webpack using awesome-typescript-loader: { …
1
vote
1 answer

storybook: use awesome-typescript-loader

By default Storybook uses babel-loader, but the current version of babel-loader is incompatible to the one Storybook requires. So I decided to use awesome-typescript-loader instead. That is, my project uses babel-loader and Storybook uses…
Cequiel
  • 2,094
  • 3
  • 20
  • 36
1
vote
0 answers

specify different development and production tsconfig file in webpack depending on NODE_ENV

I have two different files tsconfig.json and tsconfig.prod.json and I'm trying to switch between these depending on whether webpack is run in development or production mode (-d/-p). Here is my attempt at a webpack.config.js, which doesn't…
Daniel Kats
  • 4,055
  • 10
  • 47
  • 88
1
vote
1 answer

Awesome Typescript Loader throwing error about too many function arguments

I'm getting the errors while setting up the useReducer hook in Reactjs ERROR in [at-loader] ./src/reducer.ts:3:372 TS2554: Expected 2 arguments, but got 1. ERROR in [at-loader] ./src/reducer.ts:15:32 TS2554: Expected 1 arguments, but got…
peter
  • 937
  • 1
  • 10
  • 30
1
vote
0 answers

WebPack 4 fails to load `tsx` file for React: `You may need an appropriate loader to handle this file type.`

Summary: After creating a React TypeScript application and configuring WebPack 4, I get the following error when it's trying to parse a tsx file: ERROR in ./src/App.tsx 6:16 Module parse failed: Unexpected token (6:16) You may need an appropriate…
Neil
  • 20,635
  • 14
  • 48
  • 68
1
vote
2 answers

Error: Final loader didn't return a Buffer or String

I converted my GraphQL query and HOC component to typescript an am now getting the following error: ERROR in ./client/components/Protected.Route.tsx Module build failed: Error: Final loader (./node_modules/awesome-typescript-loader/dist/entry.js)…
1
vote
1 answer

How to use awesome-typescript-loader with babel to transpile a specific node module?

For awhile now I've been trying to transpile a node module that is using the object spread operator. This is a problem for me because my application is suppose to support Edge and as of now, it does not support the object spread operator. I…
Luis Averhoff
  • 557
  • 2
  • 7
  • 21
0
votes
0 answers

Module parse failed: /src/app/app.ts Unexpected token (14:5) You may need an appropriate loader to handle this file type

I'm beginning to to use webpack in my AngularJS 1.7.x project. I found this repo: https://github.com/preboot/angularjs-webpack which seemed like a good starting point. I tried to make this repo use typescript in order to apply a similar structure to…
0
votes
1 answer

Webpack output structure changes, depending on files outside the entry

My goal is to create a React component library with TypeScript. I have configured webpack to bundle my components and everything works as expected until I create a folder, that is outside the scope of the entry and which includes TypeScript files. I…
0
votes
0 answers

Cannot read property 'run' of undefined (awesome-typescript-loader)

I'm attempting to update our angular 5 application to angular 6, and am running into a build issue currently with awesome-typescript loader. The full error message…
Marshall Tigerus
  • 3,265
  • 7
  • 32
  • 60
0
votes
0 answers

What does !function do in webpack minified javascript

So I was looking at the minified javascript that webpack created from some ts files using awesome-typescript-loader and noticed that the first thing is does is !function(e){...} What does the ! before a function do? I'm familiar with the…
Drew Landgrave
  • 1,195
  • 2
  • 11
  • 22
0
votes
1 answer

Why can't I get this app to complie the typescript files into javascript using webpack and awesome typescript loader?

I have an angular 4 app and I'm using webpack and awesome typescript loader to compile the Typescript into js for the build. When I run npm run start for local it works but when I run npm run build it doesn't compile the typescript files into js and…