Skip to content

Commit

Permalink
Merge pull request #265 from alibaba/fix-webpack-public-path
Browse files Browse the repository at this point in the history
fix(@dawnjs/dn-middleware-webpack): set publicPath to "/" in development mode
  • Loading branch information
soulwu authored Jun 22, 2021
2 parents 9cb3f07 + e46d6e0 commit 8db9962
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion packages/middleware-webpack/src/config/configModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ export default async (config: Config, options: INormalizedOpts) => {
if (typeof customOptions === "function") {
customOptions = customOptions(loaderContext);
}
return { fiber: Fiber, ...customOptions };
return { fiber: Fiber, quietDeps: true, ...customOptions };
},
},
},
Expand Down
3 changes: 1 addition & 2 deletions packages/middleware-webpack/src/config/configOutput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ export default async (config: Config, options: INormalizedOpts) => {
.filename(path.join(options.folders.script, "[name].js"))
.chunkFilename(path.join(options.folders.script, "[name].[chunkhash:8].chunk.js"))
.set("assetModuleFilename", path.join(options.folders.media, "[name].[contenthash:8][ext]")) // TODO: replace after webpack-chain support webpack5
.publicPath(options.publicPath)
.globalObject("this")
.publicPath(options.publicPath ?? (options.env === "development" ? "/" : undefined))
.merge(options.output)
.path(path.resolve(options.cwd, options.output.path));
};
2 changes: 1 addition & 1 deletion packages/middleware-webpack/src/opts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const normalizeOpts = (opts: Partial<IOpts>, ctx: Context): INormalizedOp
...opts.folders,
},
babel: {
jsxRuntime: opts.jsxRuntime,
jsxRuntime: opts.jsxRuntime ?? true,
runtimeHelpers: true,
corejs: 3,
...opts.babel,
Expand Down

0 comments on commit 8db9962

Please sign in to comment.