After running a yarn build on a TypeScript project using a .projenrc.js file, make sure to include any packaged or additional text files in the lib folder, rather

After utilizing projen to create my typescript project, I followed these steps: mkdir my-project, git init, and npx projen new typescript. Additionally, I created two files - sample.txt and sample.js, along with the default file index.ts within the folder structure. Upon running yarn build, only .ts files were packaged under the lib folder, excluding the .txt and .js files. To include these additional file types in the packaging process, I attempted to modify the configuration in the .projenrc.js file as follows:

tsconfig: {
    include: [
      'src/*.txt',
      'src/*.js',
      'src/**/*.txt',
      'src/**/*.js',
    ],
    compilerOptions: {
      noUnusedLocals: false,
      noUnusedParameters: false,
    },
  },

However, this modification did not yield the desired results. Any assistance on how to address this issue would be greatly appreciated.

Answer №1

To move .txt files using a ts config alone may not work as expected. Consider setting allowJs: true in the ts config to bundle js files instead.

If you need to copy .txt files or other file types, you can use a script to achieve this. The copyfiles package could be helpful:

Check out the copyfiles npm package here

Build tools like nx () offer features that assist with asset copying, and there are likely similar functionalities in other build systems too.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Determining the perfect moment to utilize either shrinkwrap, npm-lockdown, or npm-seal

My background is more familiar with using composer, but now I am delving into setting up gulp for build processes and learning how to work with node and npm. It's interesting, coming from a composer background, that there isn't a default manifes ...

Using React for passing data

In the snippet found in "CameraPage.tsx", there is a logical function that is responsible for fetching camera images. This function simply makes a GET request to search for images stored in the backend, which will later be displayed on the FrontEnd. The op ...

What is the best way to create an interactive experience with MapLibre GL in Full Screen mode?

Hello, I am seeking a solution to create a map with the interactive option set to false, but once in full screen mode, I need this parameter to be true. Do you have any suggestions or ideas on how to achieve this? const _map = new MapGL({ contai ...

Developing single-page application frontends without utilizing node or npm

As a backend java developer with experience in spring boot, I am now exploring the world of single page applications. One aspect that appeals to me about SPA frameworks, particularly Vue, is things like model-binding and the use of components and template ...

Build a spreadsheet application for reading and writing data with the power of Node.js

I'm looking to develop a spreadsheet similar to Google Sheets with user authentication. I've hit a roadblock on where to begin with this project as I'm unsure which NPM module to utilize. Would appreciate it if someone could steer me in the ...

Quasar is having trouble locating some additional Quasar features, specifically the material-icons, roboto font css, and polyfills

Whenever I initiate quasar dev, the following message pops up. The setup is pretty standard using the pwa template. The required dependencies are missing: quasar-extras/material-icons/material-icons.css in ./.quasar/client-entry.js quasar-extras/roboto ...

Tips for preventing duplicate entries in an AG Grid component within an Angular application

In an attempt to showcase the child as only 3 columns based on assetCode, I want to display PRN, PRN1, and PRN2. Below is the code for the list component: list.component.ts this.rowData.push( { 'code': 'Machine 1', &apo ...

Is it possible to prevent the Virtual Keyboard from automatically appearing on mobile devices?

Whenever a user enters a number on a page component, the Virtual Keyboard on their Mobile device pops up and shifts the entire page. I am looking for a solution to either disable the on-screen keyboard or ensure that the text box remains visible even when ...

The error message TS2304 is indicating that the name 'Set' cannot be found in electron-builder

I am trying to utilize the AppUpdater feature in electron-builder for my Electron Application. Upon importing the updater in my main.ts file: import { autoUpdater } from "electron-updater" An error is triggered when running the application: node_module ...

Retrieve the current state of the toggle component by extracting its value from the HTML

I have a unique component that consists of a special switch and several other elements: <mat-slide-toggle (change)="toggle($event)" [checked]="false" attX="test"> ... </mat-slide-toggle> <p> ... </p> F ...

The challenge with the Optional Chaining operator in Typescript 3.7@beta

When attempting to utilize the Typescript optional chaining operator, I encountered the following exception: index.ts:6:1 - error TS2779: The left-hand side of an assignment expression may not be an optional property access. Here is my sample code: const ...

React - Encountered a compressed error

Currently, I have React JS installed through NPM and am utilizing browserify to handle components in React. Whenever there is an exception in React, the console displays this message: "Uncaught Error: Minified exception occurred; use the non-minified de ...

How does the Cluster module in Node.js compare to the Cluster module in Learnboost?

Node.js features its own Cluster core module (source: http://nodejs.org/docs/v0.8.3/api/cluster.html) while Learnboost has introduced a similarly named Cluster module as well (source: , https://github.com/LearnBoost/cluster). What are the differences betw ...

Lazy loading implemented with BootstrapVue's b-nav component

Having some trouble wrapping my head around the following issue: I've created a Vue.js component with tabs that have routes. I opted for a variation of the b-nav Tabs style (official docs) and it's functioning well in terms of tabs and routing. ...

Transform a javascript object with class attributes into a simple object while keeping the methods

I am seeking a way to convert an instance of a class into a plain object, while retaining both methods and inherited properties. Here is an example scenario: class Human { height: number; weight: number; constructor() { this.height = 1 ...

"Encountering a 'ng not found' issue while constructing an Angular application with a

Yesterday, I encountered a strange issue while working on an Angular project and deploying it using Docker. Everything was running smoothly until suddenly I hit a roadblock - I couldn't build the Docker image anymore. Here's my Dockerfile: # Stag ...

TSLint has detected an error: the name 'Observable' has been shadowed

When I run tslint, I am encountering an error that was not present before. It reads as follows: ERROR: C:/...path..to../observable-debug-operator.ts[27, 13]: Shadowed name: 'Observable' I recently implemented a debug operator to my Observable b ...

Guide on passing a customized component to the title property in Material-UI tooltip

I want to customize a Tooltip component by passing a custom component like the image shown in the link. https://i.stack.imgur.com/QkKcx.png Initially, I used Popover once, but now I prefer Tooltip because of its arrow feature. Currently, I am using Reac ...

I encountered the error message "The property you are trying to access does not exist on the type 'never'" while attempting to retrieve JSON data from the API response

Every time I attempt to access the fields in items such as id or title, an error pops up saying Property does not exist on type 'never'. Interestingly, when I log the data using console.log(response.data), everything seems to be working fine. I ...

Resolving "SyntaxError: Unexpected identifier" when using Enzyme with configurations in jest.setup.js

I'm currently facing an issue while trying to create tests in Typescript using Jest and Enzyme. The problem arises with a SyntaxError being thrown: FAIL src/_components/Button/__tests__/Button.spec.tsx ● Test suite failed to run /Users/mika ...