File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
// call like: yarn webpack build --mode production --entry ./lib/hashids.ts --env moduleTarget=esm --env engineTarget=web --env outDir=dist/umd
2
2
3
- import path from 'path'
4
- import { Compilation } from 'webpack'
3
+ import * as path from 'path'
4
+ import webpack from 'webpack'
5
5
import type { Configuration , Compiler } from 'webpack'
6
- import { ReplaceSource , Source } from 'webpack-sources'
6
+ import webpackSources from 'webpack-sources'
7
+ import type { Source } from 'webpack-sources'
8
+
9
+ const __dirname = import . meta. dirname
10
+ const { ReplaceSource } = webpackSources
7
11
8
12
type ExternalFn = Extract <
9
13
NonNullable < Configuration [ 'externals' ] > ,
@@ -18,7 +22,8 @@ class PostProcessChunkWebpackPlugin {
18
22
compilation . hooks . processAssets . tap (
19
23
{
20
24
name : 'PostProcessChunkWebpackPlugin' ,
21
- stage : Compilation . PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY ,
25
+ stage :
26
+ webpack . Compilation . PROCESS_ASSETS_STAGE_OPTIMIZE_COMPATIBILITY ,
22
27
} ,
23
28
( assetRecord ) => {
24
29
const jsAssets = Object . entries (
You can’t perform that action at this time.
0 commit comments