Skip to content
Merged
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
1 change: 0 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
},
"devDependencies": {
"@rslib/tsconfig": "workspace:*",
"@rspack/core": "1.0.8",
"@types/fs-extra": "^11.0.4",
"commander": "^12.1.0",
"fs-extra": "^11.2.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/css/RemoveCssExtractAssetPlugin.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import type { Compiler, RspackPluginInstance } from '@rspack/core';
import type { Rspack } from '@rsbuild/core';

const pluginName = 'REMOVE_CSS_EXTRACT_ASSET_PLUGIN';

type Options = {
include: RegExp;
};

class RemoveCssExtractAssetPlugin implements RspackPluginInstance {
class RemoveCssExtractAssetPlugin implements Rspack.RspackPluginInstance {
readonly name: string = pluginName;
options: Options;
constructor(options: Options) {
this.options = options;
}

apply(compiler: Compiler): void {
apply(compiler: Rspack.Compiler): void {
const include = this.options.include;
compiler.hooks.thisCompilation.tap(pluginName, (compilation) => {
compilation.hooks.chunkAsset.tap(pluginName, (_chunk, filename) => {
Expand Down
10 changes: 7 additions & 3 deletions packages/core/src/css/libCssExtractLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* 3. add `import './[name].css';`
*/
import path, { extname } from 'node:path';
import type { LoaderDefinition } from '@rspack/core';
import type { Rspack } from '@rsbuild/core';

interface DependencyDescription {
identifier: string;
Expand Down Expand Up @@ -35,7 +35,7 @@ function stringifyLocal(value: any) {
return typeof value === 'function' ? value.toString() : JSON.stringify(value);
}

const loader: LoaderDefinition = function loader(content) {
const loader: Rspack.LoaderDefinition = function loader(content) {
if (
this._compiler?.options?.experiments?.css &&
this._module &&
Expand All @@ -49,7 +49,11 @@ const loader: LoaderDefinition = function loader(content) {
return;
};

export const pitch: LoaderDefinition['pitch'] = function (request, _, _data) {
export const pitch: Rspack.LoaderDefinition['pitch'] = function (
request,
_,
_data,
) {
if (
this._compiler?.options?.experiments?.css &&
this._module &&
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/plugins/entryModuleLoader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { LoaderDefinition } from '@rspack/core';
import type { Rspack } from '@rsbuild/core';
import {
REACT_DIRECTIVE_REGEX,
RSLIB_ENTRY_QUERY,
Expand All @@ -14,7 +14,7 @@ function splitFromFirstLine(text: string): [string, string] {
return [text.slice(0, match.index), text.slice(match.index)];
}

const loader: LoaderDefinition = function loader(source) {
const loader: Rspack.LoaderDefinition = function loader(source) {
let result = source;

if (this.resourceQuery === `?${RSLIB_ENTRY_QUERY}`) {
Expand Down
108 changes: 0 additions & 108 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading