Skip to content

Commit 05cadf6

Browse files
committed
fix:webpack
1 parent fd5b70f commit 05cadf6

File tree

8 files changed

+151
-22
lines changed

8 files changed

+151
-22
lines changed

nest-cli.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,23 @@
22
"$schema": "https://json.schemastore.org/nest-cli",
33
"collection": "@nestjs/schematics",
44
"sourceRoot": "src",
5-
65
"compilerOptions": {
76
"deleteOutDir": true,
8-
"assets": [
7+
"webpack": true,
8+
"webpackConfigPath": "./webpack.config.js",
9+
"plugins": [
10+
{
11+
"name": "@nestjs/swagger",
12+
"options": {
13+
"introspectComments": true
14+
}
15+
}
16+
],
17+
"assets": [
918
{
1019
"include": "assets/**/*",
1120
"outDir": "dist/assets"
1221
}
1322
]
1423
}
15-
}
24+
}

package-lock.json

Lines changed: 126 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"@nestjs/core": "^11.0.1",
3434
"@nestjs/platform-express": "^11.0.1",
3535
"@nestjs/swagger": "^11.2.0",
36+
"copy-webpack-plugin": "^13.0.0",
3637
"nestjs-redoc": "^2.2.2",
3738
"reflect-metadata": "^0.2.2",
3839
"rxjs": "^7.8.1"

src/blocks/block-catalog.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Injectable } from '@nestjs/common';
22
import { join } from 'path';
33
import * as fs from 'fs/promises';
4-
import { collectionBlocksFiles, CollectionBlockType } from 'src/collection-blocks/collection-factory';
4+
import { collectionBlocksFiles, CollectionBlockType } from '../collection_blocks/collection_factory';
55
@Injectable()
66
export class BlockCatalogService {
77
private readonly collectionBlocks: Record<string, CollectionBlockType> = collectionBlocksFiles;
@@ -40,7 +40,7 @@ export class BlockCatalogService {
4040
return Object.entries(categoryObj.children ?? {}).map(([blockId, blockData]) => {
4141
return {
4242
id: blockId,
43-
label: blockData.label,
43+
label: blockData.label as string,
4444
path: category,
4545
file: `${this.capitalize(blockId)}.json`
4646
};
File renamed without changes.

tsconfig.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
"./node_modules/@types",
55
"types"
66
],
7+
"baseUrl": "./",
8+
"paths": {
9+
"src/*": ["src/*"]
10+
},
711
"resolveJsonModule": true,
812
"module": "commonjs",
913
"declaration": true,
@@ -14,7 +18,6 @@
1418
"target": "ES2021",
1519
"sourceMap": true,
1620
"outDir": "./dist",
17-
"baseUrl": "./",
1821
"incremental": true,
1922
"skipLibCheck": true,
2023
"strictNullChecks": true,

vercel.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"version": 2,
33
"builds": [
44
{
5-
"src": "dist/main.js",
5+
"src": "build/bundle.js",
66
"use": "@vercel/node"
77
}
88
],
99
"routes": [
1010
{
1111
"src": "/(.*)",
12-
"dest": "dist/main.js"
12+
"dest": "build/bundle.js"
1313
}
1414
]
1515
}

webpack.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ module.exports = {
1212
filename: 'bundle.js'
1313
},
1414
resolve: {
15-
extensions: ['.ts', '.js'] //resolve all the modules other than index.ts
15+
alias: {
16+
src: path.resolve(__dirname, 'src')
17+
},
18+
extensions: ['.ts', '.js', '.json']
1619
},
1720
stats: {
1821
warnings: false

0 commit comments

Comments
 (0)