Skip to content

Commit cec437f

Browse files
committed
Add __dirname polyfill
1 parent 31d61dc commit cec437f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tsconfig.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"outDir": "./dist/",
44
"noImplicitAny": true,
5-
"module": "CommonJS",
5+
"module": "esnext",
66
"target": "ES2022",
77
"allowJs": false,
88
"esModuleInterop": true,
@@ -12,7 +12,9 @@
1212
"strict": true,
1313
"forceConsistentCasingInFileNames": true,
1414
"skipLibCheck": true,
15-
15+
"allowImportingTsExtensions": true,
16+
"rewriteRelativeImportExtensions": true,
17+
"verbatimModuleSyntax": true,
1618
"alwaysStrict": true,
1719
"exactOptionalPropertyTypes": true,
1820
"noFallthroughCasesInSwitch": true,

webpack.config.ts

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ import TerserPlugin from 'terser-webpack-plugin'
55
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin'
66
import CopyPlugin from 'copy-webpack-plugin'
77

8+
import { fileURLToPath } from 'url'
9+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
10+
811
const configBuild = {
912
entry: {
1013
main: './src/index.ts',

0 commit comments

Comments
 (0)