Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix!: changed default export to named export #3353

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/arco-pro/rspack.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const path = require("path");
const { default: HtmlPlugin } = require("@rspack/plugin-html");
const { HtmlRspackPlugin } = require("@rspack/plugin-html");

const prod = process.env.NODE_ENV === "production";

Expand Down Expand Up @@ -69,7 +69,7 @@ const config = {
}
},
plugins: [
new HtmlPlugin({
new HtmlRspackPlugin({
title: "Arco Pro App",
template: path.join(__dirname, "index.html"),
favicon: path.join(__dirname, "public", "favicon.ico")
Expand Down
4 changes: 2 additions & 2 deletions examples/plugin-compat/rspack.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const BundleAnalyzerPlugin =
require("webpack-bundle-analyzer").BundleAnalyzerPlugin;
const CopyPlugin = require("copy-webpack-plugin");
const HtmlPlugin = require("@rspack/plugin-html").default;
const { HtmlRspackPlugin } = require("@rspack/plugin-html");
const { StatsWriterPlugin } = require("webpack-stats-plugin");
const minifyPlugin = require("@rspack/plugin-minify");
const manifestPlugin = require("rspack-manifest-plugin").WebpackManifestPlugin;
Expand Down Expand Up @@ -39,7 +39,7 @@ const config = {
dist: "."
}
]),
new HtmlPlugin({
new HtmlRspackPlugin({
template: "./index.ejs",
templateParameters: (compilation, assets, assetTags, options) => {
const cssFile = Object.keys(compilation.assets).filter(x =>
Expand Down
4 changes: 2 additions & 2 deletions examples/svelte/rspack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const path = require("path");
const sveltePreprocess = require("svelte-preprocess");
const { default: HtmlPlugin } = require("@rspack/plugin-html");
const { HtmlRspackPlugin } = require("@rspack/plugin-html");

const mode = process.env.NODE_ENV || "development";
const prod = mode === "production";
Expand Down Expand Up @@ -44,7 +44,7 @@ const config = {
},
mode,
plugins: [
new HtmlPlugin({
new HtmlRspackPlugin({
title: "Svelte App",
template: path.join(__dirname, "index.html"),
favicon: path.join(__dirname, "public", "favicon.png")
Expand Down
2 changes: 1 addition & 1 deletion packages/rspack-dev-middleware/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ const rdm: typeof wdm = (compiler, options) => {
});
};

export default rdm;
export * from "./middleware";
export { rdm };
2 changes: 1 addition & 1 deletion packages/rspack-dev-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import { Compiler, MultiCompiler } from "@rspack/core";
import type { Socket } from "net";
import type { FSWatcher } from "chokidar";
import rdm, { getRspackMemoryAssets } from "@rspack/dev-middleware";
import { getRspackMemoryAssets, rdm } from "@rspack/dev-middleware";
import type { Server } from "http";
import fs from "fs";
import WebpackDevServer from "webpack-dev-server";
Expand Down
14 changes: 7 additions & 7 deletions packages/rspack-plugin-html/src/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
import { Compilation } from "@rspack/core";
import { AsyncSeriesWaterfallHook } from "tapable";
import HTMLRspackPlugin, { HtmlTagObject } from "./index";
import { HtmlTagObject, HtmlRspackPlugin } from "./index";

const htmlRspackPluginHooksMap = new WeakMap<
Compilation,
Expand Down Expand Up @@ -41,7 +41,7 @@ function createHtmlRspackPluginHooks() {
manifest?: string | undefined;
};
outputName: string;
plugin: HTMLRspackPlugin;
plugin: HtmlRspackPlugin;
}>(["pluginArgs"]),
alterAssetTags: new AsyncSeriesWaterfallHook<{
assetTags: {
Expand All @@ -51,30 +51,30 @@ function createHtmlRspackPluginHooks() {
};
publicPath: string;
outputName: string;
plugin: HTMLRspackPlugin;
plugin: HtmlRspackPlugin;
}>(["pluginArgs"]),
alterAssetTagGroups: new AsyncSeriesWaterfallHook<{
headTags: HtmlTagObject[];
bodyTags: HtmlTagObject[];
publicPath: string;
outputName: string;
plugin: HTMLRspackPlugin;
plugin: HtmlRspackPlugin;
}>(["pluginArgs"]),
afterTemplateExecution: new AsyncSeriesWaterfallHook<{
html: string;
headTags: HtmlTagObject[];
bodyTags: HtmlTagObject[];
outputName: string;
plugin: HTMLRspackPlugin;
plugin: HtmlRspackPlugin;
}>(["pluginArgs"]),
beforeEmit: new AsyncSeriesWaterfallHook<{
html: string;
outputName: string;
plugin: HTMLRspackPlugin;
plugin: HtmlRspackPlugin;
}>(["pluginArgs"]),
afterEmit: new AsyncSeriesWaterfallHook<{
outputName: string;
plugin: HTMLRspackPlugin;
plugin: HtmlRspackPlugin;
}>(["pluginArgs"])
};
}
2 changes: 1 addition & 1 deletion packages/rspack-plugin-html/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export interface TemplateParameter {
webpackConfig: any;
}

export default class HtmlRspackPlugin implements RspackPluginInstance {
export class HtmlRspackPlugin implements RspackPluginInstance {
name = "HtmlRspackPlugin";

userOptions: Options;
Expand Down
Loading