Skip to content

Commit

Permalink
fix: correct umd cache directory (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript committed Oct 20, 2023
1 parent fe38596 commit 964cd8e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/builder/bundle/index.ts
Expand Up @@ -81,6 +81,10 @@ async function bundle(opts: IBundleOpts): Promise<void | IBundleWatcher> {
jsMinifier: JSMinifier.terser,
cssMinifier: CSSMinifier.cssnano,
extraBabelIncludes: [/node_modules/],

// set cache parent directory, will join it with `bundler-webpack`
// ref: https://github.com/umijs/umi/blob/8dad8c5af0197cd62db11f4b4c85d6bc1db57db1/packages/bundler-webpack/src/build.ts#L32
cacheDirectoryPath: CACHE_PATH,
},
entry: {
[path.parse(config.output.filename).name]: path.join(
Expand Down Expand Up @@ -159,7 +163,6 @@ async function bundle(opts: IBundleOpts): Promise<void | IBundleWatcher> {
? {
cache: {
buildDependencies: opts.buildDependencies,
cacheDirectory: path.join(opts.cwd, CACHE_PATH, 'bundle-webpack'),
},
}
: {}),
Expand Down

0 comments on commit 964cd8e

Please sign in to comment.