Skip to content

Commit

Permalink
install webpack, webpack-cli and ts-loader on roles-renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
ocodista committed Nov 13, 2023
1 parent 65916a0 commit 61d6e65
Show file tree
Hide file tree
Showing 3 changed files with 523 additions and 20 deletions.
10 changes: 7 additions & 3 deletions apps/auto-email-sender/roles-renderer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
"name": "roles-renderer",
"version": "1.0.0",
"description": "",
"type": "module",
"main": "dist/index.js",
"scripts": {
"build": "webpack --mode production",
"test:watch": "vitest watch",
"test": "vitest run",
"start": "ts-node src/index.ts",
Expand All @@ -21,14 +23,16 @@
"react": "^18.2.0",
"react-email": "^1.9.4",
"redis": "^4.6.7",
"shared": "*",
"vitest": "^0.34.3"
"shared": "*"
},
"devDependencies": {
"@faker-js/faker": "^8.0.2",
"@types/react": "^18.2.15",
"cross-fetch": "^4.0.0",
"ts-loader": "^9.5.0",
"typescript": "^5.1.6",
"vitest": "^0.33.0"
"vitest": "^0.34.3",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4"
}
}
35 changes: 35 additions & 0 deletions apps/auto-email-sender/roles-renderer/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import path from 'path'
import { fileURLToPath } from 'url'

const __dirname = path.dirname(fileURLToPath(import.meta.url))

const config = {
entry: path.resolve(__dirname, 'src', 'index.ts'),
module: {
rules: [
{
test: /\.tsx?$/,
use: 'ts-loader',
exclude: /node_modules/,
},
],
},
resolve: {
extensions: ['.tsx', '.ts', '.js'],
alias: {
shared: path.resolve(__dirname, '../../../packages/shared'),
},
},
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'dist'),
environment: {
module: true,
},
},
experiments: {
outputModule: true,
},
}

export default config
Loading

0 comments on commit 61d6e65

Please sign in to comment.