Ask Question

The tag has no usage guidance.

217 questions

0votes0answers21views

Ts-Loader Won't Allow Dynamic Module Imports

I am trying to compile a simple index.ts file using webpack's ts-loader; the file uses dynamic imports. In my webpack.config.js I have my alias set to: Images: `path.resolve(__dirname, './src/images'),...

MB1721's user avatar MB1721
  • 3
0votes0answers26views

Different build result between npm and pnpm

Recently, I have used pnpm instead of npm in the program. I built the project(pnpm run build) and received a ts error. (ts-loader in the webpack) It seems a TS error. but when I used npm it didn't ...

Anthony Wang's user avatar Anthony Wang
  • 111
0votes1answer78views

Webpack + ts-loader fails on stage 3 decorators: Unexpected character '@'

The following code: const decorator = (constructor: any, _context: any) => constructor @decorator export class Decorated {} fails in Webpack + ts-loader with the message: Unexpected character '@' ...

Matthieu Riegler's user avatar Matthieu Riegler
  • 37.6k
0votes0answers24views

react ts-loader not working with babel loader webpack

Trying to use ts-loader with my webpack configuration, but I keep getting errors on the terminal when I try to build. ERROR in ./src/index.ts 4:12 Module parse failed: Unterminated regular expression (...

henhen's user avatar henhen
  • 1,055
0votes1answer89views

Does 'ts-loader' require 'typescript' to be installed inorder to work? For me it worked fine

The npm documentation for using ts-loader suggests installing typescript and so does the official Typescript guide in webpack documentation without actually providing any reasoning behind it. For me, ...

JSON Derulo's user avatar JSON Derulo
  • 10.7k
17votes6answers10kviews

Webpack: import TypeScript module both "normally" and as raw string

Using webpack ^v2.2.1, I would like to import a TypeScript module as text, in addition to importing the same module "normally". I've figured that I probably should use the raw-loader. But it isn't ...

xec's user avatar xec
  • 17.6k
1vote0answers25views

How to get webpack to report typescript errors in HTML templates

I have inherited a project that is stuck on webpack 4 / angular 11 / lerna bootstrap that I am trying to upgrade to webpack 5 / workspaces etc. and it's like a Rubix cube (or Lament Configuration), so ...

Novaterata's user avatar Novaterata
  • 4,502
0votes1answer18views

Webpack can't seem to load css

I am trying to create a npm package for a single .tsx component however When I run wepback I keep getting this error: ERROR in ./src/Chatbot.tsx 184:20 Module parse failed: Unexpected token (184:20) ...

biodiscus's user avatar biodiscus
  • 495
92votes7answers86kviews

Webpack cant resolve TypeScript modules

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' ...

DYS's user avatar DYS
  • 2,896
1vote0answers671views

How to properly configure swc-loader with webpack, when switching from ts-loader for better build performance

I have a ts-loader configuration in webpack, test: /\.tsx?$/, use: [ { loader: 'ts-loader', options: { transpileOnly: true } } ] This was taking like 5 mins of build time. so, ...

Adharsh M's user avatar Adharsh M
  • 3,241
62votes4answers27kviews

Webpack cant compile ts 3.7 (Optional Chaining, Nullish Coalescing)

I try to use typescript 3.7 features like Optional Chaining, Nullish Coalescing. But webpack gives me an error while transpaling. app: Module parse failed: Unexpected token (50:40) app: File was ...

matteogll's user avatar matteogll
  • 831
0votes2answers3kviews

Problems importing Typescript and Js files in node modules

I am importing a node module folder that contains both Typescript and JS files. I use ts-loader for the typescript, but for some reason, it is creating a long list of errors and I think it's because ...

AztecCodes's user avatar AztecCodes
  • 2,451
5votes1answer2kviews

ts-loader outputs declaration files in subdirectory when importing .json files

I'm having a strange behavior of my ts-loader: When importing *.json file from node_modules the declaration files are generated in a subfolder of dist/ but I expect them to be directly in the dist/ ...

Psalchow's user avatar Psalchow
  • 93
0votes1answer242views

How to replace angular2-template-loader in Webpack 5 with ts-loader

I've inherited a Webpack4 Angular 11 lerna bootstrap repo, and I'd like to get us on Webpack5 (as well as workspaces etc.) This repo uses angular2-template-loader with ts-loader and fork-ts-checker-...

JeffryHouser's user avatar JeffryHouser
  • 39.4k
7votes2answers5kviews

Typescript Source not showing when using webpack ts-loader

I'm using webpack and ts-loader from a grunt task to transpile Typescript and generate sourcemaps for use debugging production. My team wants to be able to see the original Typescript source, not ...

Robert MacLean's user avatar Robert MacLean
  • 39.1k

153050per page

1 2 3 4 515