Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #206 from ArcticLampyrid/main
Browse files Browse the repository at this point in the history
fix: transform compiled source module resolution paths (#198)
  • Loading branch information
AlexTorresDev authored Apr 22, 2023
2 parents 76fc491 + c61aff6 commit 983b382
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 11 deletions.
91 changes: 89 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"ts-loader": "^9.4.1",
"tsconfig-paths-webpack-plugin": "^4.0.0",
"typescript": "^4.8.4",
"typescript-transform-paths": "^3.4.6",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
}
Expand Down
8 changes: 0 additions & 8 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,6 @@
"resolveJsonModule": true,
"moduleResolution": "node",
"strict": true,
"paths": {
"vs": [
"vs/*"
],
"static": [
"static/*"
],
},
"skipLibCheck": true,
},
"include": [
Expand Down
13 changes: 12 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const path = require("path");
const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin');
const createTsTransformPaths = require('typescript-transform-paths').default;

const srcPath = path.join(__dirname, "src");
const distPath = path.join(__dirname, "dist");
Expand All @@ -14,7 +15,17 @@ const commonConfig = {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
use: {
loader: "ts-loader",
options: {
getCustomTransformers: (program) => ({
before: [createTsTransformPaths(program, {})],
afterDeclarations: [createTsTransformPaths(program, {
afterDeclarations: true
})]
})
}
},
exclude: /node_modules|\.d\.ts$/
},
{
Expand Down

0 comments on commit 983b382

Please sign in to comment.