@rsbuild/shared
Advanced tools
Comparing version 0.7.0-beta.6 to 0.7.0-beta.7
@@ -213,3 +213,3 @@ import type { CopyRspackPluginOptions, Externals, SwcJsMinimizerRspackPluginOptions } from '@rspack/core'; | ||
* Set the size threshold to inline static assets such as images and fonts. | ||
* By default, static assets will be Base64 encoded and inline into the page if the size is less than 10KB. | ||
* By default, static assets will be Base64 encoded and inline into the page if the size is less than 4KiB. | ||
*/ | ||
@@ -216,0 +216,0 @@ dataUriLimit?: number | DataUriLimit; |
@@ -9,13 +9,7 @@ import type { rspack } from '@rspack/core'; | ||
import type { RspackConfig, RspackRule } from '../rspack'; | ||
import type { AutoprefixerOptions, CSSExtractOptions, CSSLoaderOptions, LessLoaderOptions, PostCSSLoaderOptions, PostCSSPlugin, SassLoaderOptions, StyleLoaderOptions, WebpackConfig } from '../thirdParty'; | ||
import type { ArrayOrNot, ChainedConfig, ChainedConfigWithUtils, FileFilterUtil, WebpackChain } from '../utils'; | ||
import type { AutoprefixerOptions, CSSExtractOptions, CSSLoaderOptions, PostCSSLoaderOptions, PostCSSPlugin, StyleLoaderOptions, WebpackConfig } from '../thirdParty'; | ||
import type { ArrayOrNot, ChainedConfig, ChainedConfigWithUtils, WebpackChain } from '../utils'; | ||
export type { HTMLPluginOptions }; | ||
export type ToolsSwcConfig = ChainedConfig<SwcLoaderOptions>; | ||
export type ToolsAutoprefixerConfig = ChainedConfig<AutoprefixerOptions>; | ||
export type ToolsSassConfig = ChainedConfigWithUtils<SassLoaderOptions, { | ||
addExcludes: FileFilterUtil; | ||
}>; | ||
export type ToolsLessConfig = ChainedConfigWithUtils<LessLoaderOptions, { | ||
addExcludes: FileFilterUtil; | ||
}>; | ||
export type ToolsBundlerChainConfig = ArrayOrNot<(chain: BundlerChain, utils: ModifyBundlerChainUtils) => void>; | ||
@@ -44,10 +38,2 @@ export type ToolsPostCSSLoaderConfig = ChainedConfigWithUtils<PostCSSLoaderOptions, { | ||
/** | ||
* Modify the config of [sass-loader](https://github.com/webpack-contrib/sass-loader). | ||
*/ | ||
sass?: ToolsSassConfig; | ||
/** | ||
* Modify the config of [less-loader](https://github.com/webpack-contrib/less-loader). | ||
*/ | ||
less?: ToolsLessConfig; | ||
/** | ||
* Configure bundler config base on [webpack-chain](https://github.com/neutrinojs/webpack-chain) | ||
@@ -54,0 +40,0 @@ */ |
@@ -1,2 +0,2 @@ | ||
import type { CssExtractRspackLoaderOptions, CssExtractRspackPluginOptions, LoaderContext } from '@rspack/core'; | ||
import type { CssExtractRspackLoaderOptions, CssExtractRspackPluginOptions } from '@rspack/core'; | ||
import type { AcceptedPlugin, ProcessOptions } from 'postcss'; | ||
@@ -6,5 +6,2 @@ import type { MinifyOptions } from 'terser'; | ||
import type Autoprefixer from '../../compiled/autoprefixer/index.js'; | ||
import type Less from '../../compiled/less/index.js'; | ||
import type SassLoader from '../../compiled/sass-loader/index.js'; | ||
import type { LegacyOptions as LegacySassOptions, Options as SassOptions } from '../../compiled/sass/index.js'; | ||
type AutoprefixerOptions = Autoprefixer.Options; | ||
@@ -18,16 +15,2 @@ export interface CSSExtractOptions { | ||
export type MinifyJSOptions = MinifyOptions; | ||
export type SassLoaderOptions = Omit<SassLoader.Options, 'sassOptions'> & ({ | ||
api?: 'legacy'; | ||
sassOptions?: Partial<LegacySassOptions<'async'>>; | ||
} | { | ||
api: 'modern'; | ||
sassOptions?: SassOptions<'async'>; | ||
}); | ||
export type LessLoaderOptions = { | ||
lessOptions?: Less.Options; | ||
additionalData?: string | ((content: string, loaderContext: LoaderContext<LessLoaderOptions>) => string | Promise<string>); | ||
sourceMap?: boolean; | ||
webpackImporter?: boolean; | ||
implementation?: unknown; | ||
}; | ||
export type PostCSSOptions = ProcessOptions & { | ||
@@ -34,0 +17,0 @@ config?: boolean; |
@@ -16,5 +16,4 @@ import type WebpackChain from '../../compiled/webpack-chain/index.js'; | ||
export type FileFilterUtil = (items: ArrayOrNot<string | RegExp>) => void; | ||
export type SharedCompiledPkgNames = 'sass' | 'less' | 'autoprefixer' | 'sass-loader'; | ||
export type CompilerTapFn<CallBack extends (...args: any[]) => void = () => void> = { | ||
tap: (name: string, cb: CallBack) => void; | ||
}; |
@@ -5,3 +5,3 @@ import type { Compiler, MultiCompiler } from '@rspack/core'; | ||
import color from '../compiled/picocolors/index.js'; | ||
import type { CacheGroups, ModifyChainUtils, MultiStats, NodeEnv, NormalizedConfig, RsbuildTarget, SharedCompiledPkgNames, Stats } from './types'; | ||
import type { CacheGroups, ModifyChainUtils, MultiStats, NodeEnv, NormalizedConfig, RsbuildTarget, Stats } from './types'; | ||
export { color, deepmerge }; | ||
@@ -29,2 +29,3 @@ export type Colors = Omit<keyof typeof color, 'createColor' | 'isColorSupported'>; | ||
export declare const getJsSourceMap: (config: NormalizedConfig) => false | "eval" | "cheap-source-map" | "cheap-module-source-map" | "source-map" | "inline-cheap-source-map" | "inline-cheap-module-source-map" | "inline-source-map" | "inline-nosources-cheap-source-map" | "inline-nosources-cheap-module-source-map" | "inline-nosources-source-map" | "nosources-cheap-source-map" | "nosources-cheap-module-source-map" | "nosources-source-map" | "hidden-nosources-cheap-source-map" | "hidden-nosources-cheap-module-source-map" | "hidden-nosources-source-map" | "hidden-cheap-source-map" | "hidden-cheap-module-source-map" | "hidden-source-map" | "eval-cheap-source-map" | "eval-cheap-module-source-map" | "eval-source-map" | "eval-nosources-cheap-source-map" | "eval-nosources-cheap-module-source-map" | "eval-nosources-source-map"; | ||
export type SharedCompiledPkgNames = 'autoprefixer'; | ||
export declare const getSharedPkgCompiledPath: (packageName: SharedCompiledPkgNames) => string; | ||
@@ -31,0 +32,0 @@ export declare const isURL: (str: string) => boolean; |
{ | ||
"name": "@rsbuild/shared", | ||
"version": "0.7.0-beta.6", | ||
"version": "0.7.0-beta.7", | ||
"description": "The internal shared modules and dependencies of Rsbuild.", | ||
@@ -27,6 +27,2 @@ "homepage": "https://rsbuild.dev", | ||
}, | ||
"./less": { | ||
"types": "./compiled/less/index.d.ts", | ||
"default": "./compiled/less/index.js" | ||
}, | ||
"./yaml": { | ||
@@ -101,5 +97,3 @@ "types": "./compiled/yaml/index.d.ts", | ||
"@types/fs-extra": "^11.0.4", | ||
"@types/less": "3.0.6", | ||
"@types/node": "18.x", | ||
"@types/sass-loader": "8.0.8", | ||
"@types/webpack-bundle-analyzer": "4.7.0", | ||
@@ -116,3 +110,2 @@ "autoprefixer": "10.4.19", | ||
"json5": "^2.2.3", | ||
"less": "4.2.0", | ||
"loader-utils2": "npm:loader-utils@2.0.4", | ||
@@ -123,4 +116,2 @@ "mime-types": "^2.1.35", | ||
"rslog": "^1.2.2", | ||
"sass": "^1.77.1", | ||
"sass-loader": "14.2.1", | ||
"semver": "^7.6.2", | ||
@@ -127,0 +118,0 @@ "terser": "5.31.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
27
76
13
4550572
108
76877