TypeScript node server setup. How to remove all *.d.ts files in dist folder?
Asked Answered
M

1

5

When I deploy my server I got errors

server_1    | (node:9) UnhandledPromiseRejectionWarning: /usr/app/packages/server/dist/modules/listing/create/resolvers.d.ts:1
server_1    | (function (exports, require, module, __filename, __dirname) { import { MutationResolvers } from '../../../types';
server_1    |                                                                      ^
server_1    | 
server_1    | SyntaxError: Unexpected token {

My solution(it works) is removing all *.d.ts files anywhere. Here is my packages.json script and its mass

    "build": "tsc -b && copyfiles -u 1 src/**/*.graphql dist/ && rimraf ./dist/*.d.ts && rimraf ./dist/**/*.d.ts && rimraf ./dist/**/**/*.d.ts && rimraf ./dist/**/**/**/*.d.ts"

How can I remove all *.d.ts files in dist folder without folder nesting?

Margarethe answered 3/1, 2019 at 8:21 Comment(1)
** should go as deep as needed. Does rimraf ./dist/**/*.d.ts alone work?Impertinence
A
15

You can use this one

find ./ -name "*.d.ts" -delete
Accuracy answered 7/1, 2019 at 15:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.