Skip to content

Commit

Permalink
fix(rspack): removed webpack-sources import
Browse files Browse the repository at this point in the history
removed the webpack-sources import and replaced it with the sources export from rspack
  • Loading branch information
Phillip9587 committed Oct 1, 2024
1 parent b0071a1 commit 6df7c72
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/rspack/src/plugins/generate-package-json-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ import {
getLockFileName,
readTsConfig,
} from '@nx/js';
import { type Compiler, type RspackPluginInstance } from '@rspack/core';
import { RawSource } from 'webpack-sources';
import {
type Compiler,
type RspackPluginInstance,
sources,
} from '@rspack/core';

const pluginName = 'GeneratePackageJsonPlugin';

Expand Down Expand Up @@ -71,12 +74,12 @@ export class GeneratePackageJsonPlugin implements RspackPluginInstance {

compilation.emitAsset(
'package.json',
new RawSource(serializeJson(packageJson))
new sources.RawSource(serializeJson(packageJson))
);
const packageManager = detectPackageManager(this.context.root);
compilation.emitAsset(
getLockFileName(packageManager),
new RawSource(
new sources.RawSource(
createLockFile(packageJson, this.projectGraph, packageManager)
)
);
Expand Down

0 comments on commit 6df7c72

Please sign in to comment.