Skip to content

Commit

Permalink
add deps and config (#6190)
Browse files Browse the repository at this point in the history
Co-authored-by: rotorsoft <[email protected]>
  • Loading branch information
Rotorsoft and rotorsoft authored Jan 4, 2024
1 parent 84b6f2b commit 954fdce
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@
"prettier-plugin-organize-imports": "^3.2.3",
"stylelint": "^14.14.1",
"stylelint-config-prettier": "^9.0.4",
"stylelint-config-standard": "^29.0.0"
"stylelint-config-standard": "^29.0.0",
"tsconfig-paths": "^4.2.0",
"tsconfig-paths-webpack-plugin": "^4.1.0"
},
"resolutions": {
"quill": "^1.3.6",
Expand Down
18 changes: 3 additions & 15 deletions packages/commonwealth/webpack/webpack.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const path = require('path');
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const HtmlWebpackInjectAttributesPlugin = require('html-webpack-inject-attributes-plugin');
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');

require('dotenv').config();

Expand Down Expand Up @@ -150,6 +151,7 @@ module.exports = {
},
},
resolve: {
plugins: [new TsconfigPathsPlugin({})],
extensions: ['.ts', '.tsx', '.mjs', '.js', '.jsx', '.svg'],
modules: [
'../client/scripts',
Expand All @@ -158,14 +160,6 @@ module.exports = {
'node_modules', // local node modules
'../node_modules', // global node modules
],
alias: {
'common-common': path.resolve(__dirname, '../../common-common'),
'chain-events': path.resolve(__dirname, '../../chain-events'),
'token-balance-cache': path.resolve(
__dirname,
'../../token-balance-cache',
),
},
fallback: {
fs: false,
net: false,
Expand All @@ -184,13 +178,7 @@ module.exports = {
{
// ignore ".spec.ts" test files in build
test: /^(?!.*\.spec\.ts$).*(?:\.ts)$/,
include: [
path.resolve(__dirname, '../client'),
path.resolve(__dirname, '../shared'),
path.resolve(__dirname, '../../common-common'),
path.resolve(__dirname, '../../chain-events'),
path.resolve(__dirname, '../../token-balance-cache'),
],

loader: 'esbuild-loader',
options: {
loader: 'ts',
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@
"discord-bot": ["./packages/discord-bot"],
"discord-bot/*": ["./packages/discord-bot/*"]
}
},
"ts-node": {
"require": ["tsconfig-paths/register"]
}
}
11 changes: 10 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23616,6 +23616,15 @@ tsc-alias@^1.7.0:
normalize-path "^3.0.0"
plimit-lit "^1.2.6"

tsconfig-paths-webpack-plugin@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-4.1.0.tgz#3c6892c5e7319c146eee1e7302ed9e6f2be4f763"
integrity sha512-xWFISjviPydmtmgeUAuXp4N1fky+VCtfhOkDUFIv5ea7p4wuTomI4QTrXvFBX2S4jZsmyTSrStQl+E+4w+RzxA==
dependencies:
chalk "^4.1.0"
enhanced-resolve "^5.7.0"
tsconfig-paths "^4.1.2"

tsconfig-paths@^3.5.0:
version "3.9.0"
resolved "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz"
Expand All @@ -23626,7 +23635,7 @@ tsconfig-paths@^3.5.0:
minimist "^1.2.0"
strip-bom "^3.0.0"

tsconfig-paths@^4.2.0:
tsconfig-paths@^4.1.2, tsconfig-paths@^4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz#ef78e19039133446d244beac0fd6a1632e2d107c"
integrity sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg==
Expand Down

0 comments on commit 954fdce

Please sign in to comment.