@rsbuild/core 2.0.0-alpha.0 → 2.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled/chokidar/handler.d.ts +90 -0
- package/compiled/chokidar/index.d.ts +34 -201
- package/compiled/chokidar/package.json +1 -1
- package/compiled/css-loader/index.js +2 -2
- package/compiled/html-rspack-plugin/index.js +14 -14
- package/compiled/postcss-loader/index.js +6 -6
- package/compiled/rslog/package.json +1 -1
- package/compiled/rspack-chain/package.json +1 -1
- package/compiled/rspack-chain/types/index.d.ts +8 -59
- package/dist/131.js +96 -148
- package/dist/397.js +11 -0
- package/dist/7.js +1 -0
- package/dist/chokidar.js +1044 -0
- package/dist/chokidar.js.LICENSE.txt +1 -0
- package/dist/manifest-plugin.js +8 -13
- package/dist/memfs.js +1 -8
- package/dist/open.js +1 -1
- package/dist-types/configChain.d.ts +2 -9
- package/dist-types/helpers/vendors.d.ts +0 -1
- package/dist-types/index.d.ts +1 -1
- package/dist-types/types/config.d.ts +11 -19
- package/dist-types/types/rspack.d.ts +1 -7
- package/package.json +8 -8
- package/compiled/chokidar/index.js +0 -1793
- package/dist-types/plugins/moment.d.ts +0 -2
package/dist/131.js
CHANGED
|
@@ -15,7 +15,7 @@ import * as __rspack_external_path from "path";
|
|
|
15
15
|
import * as __rspack_external_url from "url";
|
|
16
16
|
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
17
17
|
import node_process from "node:process";
|
|
18
|
-
import node_os, { constants as external_node_os_constants } from "node:os";
|
|
18
|
+
import node_os, { constants as external_node_os_constants, type as external_node_os_type } from "node:os";
|
|
19
19
|
import node_tty from "node:tty";
|
|
20
20
|
import { promisify as external_node_util_promisify, stripVTControlCharacters } from "node:util";
|
|
21
21
|
import { isPromise, isRegExp } from "node:util/types";
|
|
@@ -1695,69 +1695,6 @@ let ChainedMap = createMap(createChainable(Object)), ChainedValueMap = (superCla
|
|
|
1695
1695
|
constructor(...args){
|
|
1696
1696
|
super(...args), this.store = new Set();
|
|
1697
1697
|
}
|
|
1698
|
-
}), Orderable = (Class)=>class extends Class {
|
|
1699
|
-
before(name) {
|
|
1700
|
-
if (this.__after) throw Error(`Unable to set .before(${JSON.stringify(name)}) with existing value for .after()`);
|
|
1701
|
-
return this.__before = name, this;
|
|
1702
|
-
}
|
|
1703
|
-
after(name) {
|
|
1704
|
-
if (this.__before) throw Error(`Unable to set .after(${JSON.stringify(name)}) with existing value for .before()`);
|
|
1705
|
-
return this.__after = name, this;
|
|
1706
|
-
}
|
|
1707
|
-
merge(obj, omit = []) {
|
|
1708
|
-
return obj.before && this.before(obj.before), obj.after && this.after(obj.after), super.merge(obj, [
|
|
1709
|
-
...omit,
|
|
1710
|
-
'before',
|
|
1711
|
-
'after'
|
|
1712
|
-
]);
|
|
1713
|
-
}
|
|
1714
|
-
}, src_Plugin = Orderable(class extends ChainedMap {
|
|
1715
|
-
use(plugin, args = []) {
|
|
1716
|
-
return this.set('plugin', plugin).set('args', args);
|
|
1717
|
-
}
|
|
1718
|
-
tap(f) {
|
|
1719
|
-
if (!this.has('plugin')) throw Error(`Cannot call .tap() on a plugin that has not yet been defined. Call ${this.type}('${this.name}').use(<Plugin>) first.`);
|
|
1720
|
-
return this.set('args', f(this.get('args') || [])), this;
|
|
1721
|
-
}
|
|
1722
|
-
set(key, value) {
|
|
1723
|
-
if ('args' === key && !Array.isArray(value)) throw Error('args must be an array of arguments');
|
|
1724
|
-
return super.set(key, value);
|
|
1725
|
-
}
|
|
1726
|
-
merge(obj, omit = []) {
|
|
1727
|
-
return 'plugin' in obj && this.set('plugin', obj.plugin), 'args' in obj && this.set('args', obj.args), super.merge(obj, [
|
|
1728
|
-
...omit,
|
|
1729
|
-
'args',
|
|
1730
|
-
'plugin'
|
|
1731
|
-
]);
|
|
1732
|
-
}
|
|
1733
|
-
toConfig() {
|
|
1734
|
-
let init = this.get('init'), plugin = this.get('plugin'), args = this.get('args'), pluginPath = null;
|
|
1735
|
-
if (void 0 === plugin) throw Error(`Invalid ${this.type} configuration: ${this.type}('${this.name}').use(<Plugin>) was not called to specify the plugin`);
|
|
1736
|
-
'string' == typeof plugin && (plugin = require(pluginPath = plugin));
|
|
1737
|
-
let constructorName = plugin.__expression ? `(${plugin.__expression})` : plugin.name, config = init(plugin, args);
|
|
1738
|
-
return Object.defineProperties(config, {
|
|
1739
|
-
__pluginName: {
|
|
1740
|
-
value: this.name
|
|
1741
|
-
},
|
|
1742
|
-
__pluginType: {
|
|
1743
|
-
value: this.type
|
|
1744
|
-
},
|
|
1745
|
-
__pluginArgs: {
|
|
1746
|
-
value: args
|
|
1747
|
-
},
|
|
1748
|
-
__pluginConstructorName: {
|
|
1749
|
-
value: constructorName
|
|
1750
|
-
},
|
|
1751
|
-
__pluginPath: {
|
|
1752
|
-
value: pluginPath
|
|
1753
|
-
}
|
|
1754
|
-
}), config;
|
|
1755
|
-
}
|
|
1756
|
-
constructor(parent, name, type = 'plugin'){
|
|
1757
|
-
super(parent), this.name = name, this.type = type, this.extend([
|
|
1758
|
-
'init'
|
|
1759
|
-
]), this.init((Plugin, args = [])=>'function' == typeof Plugin ? new Plugin(...args) : Plugin);
|
|
1760
|
-
}
|
|
1761
1698
|
}), childMaps = [
|
|
1762
1699
|
'alias',
|
|
1763
1700
|
'fallback',
|
|
@@ -1777,16 +1714,11 @@ let ChainedMap = createMap(createChainable(Object)), ChainedValueMap = (superCla
|
|
|
1777
1714
|
'modules'
|
|
1778
1715
|
];
|
|
1779
1716
|
class Resolve_class extends ChainedMap {
|
|
1780
|
-
plugin(name) {
|
|
1781
|
-
return this.plugins.getOrCompute(name, ()=>new src_Plugin(this, name, 'resolve.plugin'));
|
|
1782
|
-
}
|
|
1783
1717
|
get(key) {
|
|
1784
1718
|
return childMaps.includes(key) ? this[key].entries() : childSets.includes(key) ? this[key].values() : super.get(key);
|
|
1785
1719
|
}
|
|
1786
1720
|
toConfig() {
|
|
1787
|
-
let config = Object.assign(this.entries() || {}
|
|
1788
|
-
plugins: this.plugins.values().map((plugin)=>plugin.toConfig())
|
|
1789
|
-
});
|
|
1721
|
+
let config = Object.assign(this.entries() || {});
|
|
1790
1722
|
return childMaps.forEach((key)=>{
|
|
1791
1723
|
config[key] = this[key].entries();
|
|
1792
1724
|
}), childSets.forEach((key)=>{
|
|
@@ -1794,7 +1726,6 @@ class Resolve_class extends ChainedMap {
|
|
|
1794
1726
|
}), this.clean(config);
|
|
1795
1727
|
}
|
|
1796
1728
|
merge(obj, omit = []) {
|
|
1797
|
-
!omit.includes('plugin') && 'plugin' in obj && Object.keys(obj.plugin).forEach((name)=>this.plugin(name).merge(obj.plugin[name]));
|
|
1798
1729
|
let omissions = [
|
|
1799
1730
|
...childMaps,
|
|
1800
1731
|
...childSets
|
|
@@ -1803,8 +1734,7 @@ class Resolve_class extends ChainedMap {
|
|
|
1803
1734
|
!omit.includes(key) && key in obj && this[key].merge(obj[key]);
|
|
1804
1735
|
}), super.merge(obj, [
|
|
1805
1736
|
...omit,
|
|
1806
|
-
...omissions
|
|
1807
|
-
'plugin'
|
|
1737
|
+
...omissions
|
|
1808
1738
|
]);
|
|
1809
1739
|
}
|
|
1810
1740
|
constructor(parent){
|
|
@@ -1812,12 +1742,9 @@ class Resolve_class extends ChainedMap {
|
|
|
1812
1742
|
this[key] = new ChainedMap(this);
|
|
1813
1743
|
}), childSets.forEach((key)=>{
|
|
1814
1744
|
this[key] = new ChainedSet(this);
|
|
1815
|
-
}), this.
|
|
1816
|
-
'cachePredicate',
|
|
1817
|
-
'cacheWithContext',
|
|
1745
|
+
}), this.extend([
|
|
1818
1746
|
'enforceExtension',
|
|
1819
1747
|
'symlinks',
|
|
1820
|
-
'unsafeCache',
|
|
1821
1748
|
'preferRelative',
|
|
1822
1749
|
'preferAbsolute',
|
|
1823
1750
|
'tsConfig'
|
|
@@ -1853,8 +1780,8 @@ class ResolveLoader_class extends Resolve_class {
|
|
|
1853
1780
|
class Output_class extends ChainedMap {
|
|
1854
1781
|
constructor(parent){
|
|
1855
1782
|
super(parent), this.extend([
|
|
1856
|
-
'
|
|
1857
|
-
'
|
|
1783
|
+
'assetModuleFilename',
|
|
1784
|
+
'bundlerInfo',
|
|
1858
1785
|
'chunkFilename',
|
|
1859
1786
|
'chunkLoadTimeout',
|
|
1860
1787
|
'chunkLoadingGlobal',
|
|
@@ -1866,7 +1793,6 @@ class Output_class extends ChainedMap {
|
|
|
1866
1793
|
'devtoolModuleFilenameTemplate',
|
|
1867
1794
|
'devtoolNamespace',
|
|
1868
1795
|
'filename',
|
|
1869
|
-
'assetModuleFilename',
|
|
1870
1796
|
'globalObject',
|
|
1871
1797
|
'uniqueName',
|
|
1872
1798
|
'hashDigest',
|
|
@@ -1877,18 +1803,14 @@ class Output_class extends ChainedMap {
|
|
|
1877
1803
|
'hotUpdateGlobal',
|
|
1878
1804
|
'hotUpdateMainFilename',
|
|
1879
1805
|
'library',
|
|
1880
|
-
'libraryExport',
|
|
1881
|
-
'libraryTarget',
|
|
1882
1806
|
'importFunctionName',
|
|
1883
1807
|
'path',
|
|
1884
1808
|
'pathinfo',
|
|
1885
1809
|
'publicPath',
|
|
1886
1810
|
"scriptType",
|
|
1887
1811
|
'sourceMapFilename',
|
|
1888
|
-
'sourcePrefix',
|
|
1889
1812
|
'strictModuleErrorHandling',
|
|
1890
1813
|
'strictModuleExceptionHandling',
|
|
1891
|
-
'umdNamedDefine',
|
|
1892
1814
|
'workerChunkLoading',
|
|
1893
1815
|
'enabledLibraryTypes',
|
|
1894
1816
|
'environment',
|
|
@@ -1969,7 +1891,70 @@ class DevServer_class extends ChainedMap {
|
|
|
1969
1891
|
]);
|
|
1970
1892
|
}
|
|
1971
1893
|
}
|
|
1972
|
-
let
|
|
1894
|
+
let Orderable = (Class)=>class extends Class {
|
|
1895
|
+
before(name) {
|
|
1896
|
+
if (this.__after) throw Error(`Unable to set .before(${JSON.stringify(name)}) with existing value for .after()`);
|
|
1897
|
+
return this.__before = name, this;
|
|
1898
|
+
}
|
|
1899
|
+
after(name) {
|
|
1900
|
+
if (this.__before) throw Error(`Unable to set .after(${JSON.stringify(name)}) with existing value for .before()`);
|
|
1901
|
+
return this.__after = name, this;
|
|
1902
|
+
}
|
|
1903
|
+
merge(obj, omit = []) {
|
|
1904
|
+
return obj.before && this.before(obj.before), obj.after && this.after(obj.after), super.merge(obj, [
|
|
1905
|
+
...omit,
|
|
1906
|
+
'before',
|
|
1907
|
+
'after'
|
|
1908
|
+
]);
|
|
1909
|
+
}
|
|
1910
|
+
}, src_Plugin = Orderable(class extends ChainedMap {
|
|
1911
|
+
use(plugin, args = []) {
|
|
1912
|
+
return this.set('plugin', plugin).set('args', args);
|
|
1913
|
+
}
|
|
1914
|
+
tap(f) {
|
|
1915
|
+
if (!this.has('plugin')) throw Error(`Cannot call .tap() on a plugin that has not yet been defined. Call ${this.type}('${this.name}').use(<Plugin>) first.`);
|
|
1916
|
+
return this.set('args', f(this.get('args') || [])), this;
|
|
1917
|
+
}
|
|
1918
|
+
set(key, value) {
|
|
1919
|
+
if ('args' === key && !Array.isArray(value)) throw Error('args must be an array of arguments');
|
|
1920
|
+
return super.set(key, value);
|
|
1921
|
+
}
|
|
1922
|
+
merge(obj, omit = []) {
|
|
1923
|
+
return 'plugin' in obj && this.set('plugin', obj.plugin), 'args' in obj && this.set('args', obj.args), super.merge(obj, [
|
|
1924
|
+
...omit,
|
|
1925
|
+
'args',
|
|
1926
|
+
'plugin'
|
|
1927
|
+
]);
|
|
1928
|
+
}
|
|
1929
|
+
toConfig() {
|
|
1930
|
+
let init = this.get('init'), plugin = this.get('plugin'), args = this.get('args'), pluginPath = null;
|
|
1931
|
+
if (void 0 === plugin) throw Error(`Invalid ${this.type} configuration: ${this.type}('${this.name}').use(<Plugin>) was not called to specify the plugin`);
|
|
1932
|
+
'string' == typeof plugin && (plugin = require(pluginPath = plugin));
|
|
1933
|
+
let constructorName = plugin.__expression ? `(${plugin.__expression})` : plugin.name, config = init(plugin, args);
|
|
1934
|
+
return Object.defineProperties(config, {
|
|
1935
|
+
__pluginName: {
|
|
1936
|
+
value: this.name
|
|
1937
|
+
},
|
|
1938
|
+
__pluginType: {
|
|
1939
|
+
value: this.type
|
|
1940
|
+
},
|
|
1941
|
+
__pluginArgs: {
|
|
1942
|
+
value: args
|
|
1943
|
+
},
|
|
1944
|
+
__pluginConstructorName: {
|
|
1945
|
+
value: constructorName
|
|
1946
|
+
},
|
|
1947
|
+
__pluginPath: {
|
|
1948
|
+
value: pluginPath
|
|
1949
|
+
}
|
|
1950
|
+
}), config;
|
|
1951
|
+
}
|
|
1952
|
+
constructor(parent, name, type = 'plugin'){
|
|
1953
|
+
super(parent), this.name = name, this.type = type, this.extend([
|
|
1954
|
+
'init'
|
|
1955
|
+
]), this.init((Plugin, args = [])=>'function' == typeof Plugin ? new Plugin(...args) : Plugin);
|
|
1956
|
+
}
|
|
1957
|
+
}), Use = Orderable(class extends ChainedMap {
|
|
1973
1958
|
tap(f) {
|
|
1974
1959
|
return this.options(f(this.get('options'))), this;
|
|
1975
1960
|
}
|
|
@@ -2102,12 +2087,7 @@ class Module_class extends ChainedMap {
|
|
|
2102
2087
|
constructor(parent){
|
|
2103
2088
|
super(parent), this.rules = new ChainedMap(this), this.defaultRules = new ChainedMap(this), this.generator = new ChainedMap(this), this.parser = new ChainedMap(this), this.extend([
|
|
2104
2089
|
'noParse',
|
|
2105
|
-
'unsafeCache'
|
|
2106
|
-
'wrappedContextCritical',
|
|
2107
|
-
'exprContextRegExp',
|
|
2108
|
-
'wrappedContextRecursive',
|
|
2109
|
-
'strictExportPresence',
|
|
2110
|
-
'wrappedContextRegExp'
|
|
2090
|
+
'unsafeCache'
|
|
2111
2091
|
]);
|
|
2112
2092
|
}
|
|
2113
2093
|
}
|
|
@@ -2136,16 +2116,13 @@ class Optimization_class extends ChainedMap {
|
|
|
2136
2116
|
'moduleIds',
|
|
2137
2117
|
'chunkIds',
|
|
2138
2118
|
'nodeEnv',
|
|
2139
|
-
'mangleWasmImports',
|
|
2140
2119
|
'removeAvailableModules',
|
|
2141
2120
|
'removeEmptyChunks',
|
|
2142
2121
|
'mergeDuplicateChunks',
|
|
2143
|
-
'flagIncludedChunks',
|
|
2144
2122
|
'providedExports',
|
|
2145
2123
|
'usedExports',
|
|
2146
2124
|
'concatenateModules',
|
|
2147
2125
|
'sideEffects',
|
|
2148
|
-
'portableRecords',
|
|
2149
2126
|
'mangleExports',
|
|
2150
2127
|
'innerGraph',
|
|
2151
2128
|
'inlineExports',
|
|
@@ -2269,11 +2246,7 @@ class src_class extends ChainedMap {
|
|
|
2269
2246
|
'dependencies',
|
|
2270
2247
|
'ignoreWarnings',
|
|
2271
2248
|
'loader',
|
|
2272
|
-
'parallelism',
|
|
2273
2249
|
'profile',
|
|
2274
|
-
'recordsPath',
|
|
2275
|
-
'recordsInputPath',
|
|
2276
|
-
'recordsOutputPath',
|
|
2277
2250
|
'name',
|
|
2278
2251
|
'infrastructureLogging',
|
|
2279
2252
|
'snapshot',
|
|
@@ -3022,7 +2995,6 @@ let OVERRIDE_PATHS = new Set([
|
|
|
3022
2995
|
performance: {
|
|
3023
2996
|
printFileSize: !0,
|
|
3024
2997
|
removeConsole: !1,
|
|
3025
|
-
removeMomentLocale: !1,
|
|
3026
2998
|
chunkSplit: {
|
|
3027
2999
|
strategy: 'split-by-experience'
|
|
3028
3000
|
}
|
|
@@ -3474,7 +3446,7 @@ function createPublicContext(context) {
|
|
|
3474
3446
|
async function createContext(options, userConfig) {
|
|
3475
3447
|
let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0;
|
|
3476
3448
|
return {
|
|
3477
|
-
version: "2.0.0-alpha.
|
|
3449
|
+
version: "2.0.0-alpha.2",
|
|
3478
3450
|
rootPath,
|
|
3479
3451
|
distPath: '',
|
|
3480
3452
|
cachePath,
|
|
@@ -3686,7 +3658,6 @@ let configChain_CHAIN_ID = {
|
|
|
3686
3658
|
POSTCSS: 'postcss',
|
|
3687
3659
|
LIGHTNINGCSS: 'lightningcss',
|
|
3688
3660
|
IGNORE_CSS: 'ignore-css',
|
|
3689
|
-
CSS_MODULES_TS: "css-modules-typescript",
|
|
3690
3661
|
MINI_CSS_EXTRACT: 'mini-css-extract',
|
|
3691
3662
|
RESOLVE_URL: 'resolve-url-loader'
|
|
3692
3663
|
},
|
|
@@ -3696,7 +3667,7 @@ let configChain_CHAIN_ID = {
|
|
|
3696
3667
|
HTML: 'html',
|
|
3697
3668
|
DEFINE: 'define',
|
|
3698
3669
|
PROGRESS: 'progress',
|
|
3699
|
-
MANIFEST: '
|
|
3670
|
+
MANIFEST: 'rspack-manifest',
|
|
3700
3671
|
TS_CHECKER: 'ts-checker',
|
|
3701
3672
|
MODULE_FEDERATION: 'module-federation',
|
|
3702
3673
|
HTML_PREFETCH: 'html-prefetch-plugin',
|
|
@@ -3709,9 +3680,6 @@ let configChain_CHAIN_ID = {
|
|
|
3709
3680
|
MINIMIZER: {
|
|
3710
3681
|
JS: 'js',
|
|
3711
3682
|
CSS: 'css'
|
|
3712
|
-
},
|
|
3713
|
-
RESOLVE_PLUGIN: {
|
|
3714
|
-
TS_CONFIG_PATHS: 'ts-config-paths'
|
|
3715
3683
|
}
|
|
3716
3684
|
}, vendors_require = (0, external_node_module_.createRequire)(import.meta.url), requireCompiledPackage = (name)=>vendors_require(`${COMPILED_PATH}/${name}/index.js`);
|
|
3717
3685
|
function pluginHelper_getHTMLPlugin(config) {
|
|
@@ -3879,7 +3847,7 @@ async function initRsbuildConfig({ context, pluginManager }) {
|
|
|
3879
3847
|
let defaultEntry, { environments, dev, server: _server, ...baseConfig } = normalizedConfig, isEnvironmentEnabled = (name)=>!specifiedEnvironments || specifiedEnvironments.includes(name), applyEnvironmentDefaultConfig = (config)=>{
|
|
3880
3848
|
config.source.entry && 0 !== Object.keys(config.source.entry).length || (config.source.entry = (defaultEntry || (defaultEntry = getDefaultEntry(rootPath)), defaultEntry));
|
|
3881
3849
|
let isServer = 'node' === config.output.target;
|
|
3882
|
-
return void 0 === config.output.distPath.js && (config.output.distPath.js = isServer ? '' : 'static/js'), void 0 === config.output.module && (config.output.module = isServer), config;
|
|
3850
|
+
return void 0 === config.output.distPath.js && (config.output.distPath.js = isServer ? '' : 'static/js'), void 0 === config.output.module && (config.output.module = isServer), void 0 === config.output.minify && (config.output.minify = !isServer), config;
|
|
3883
3851
|
};
|
|
3884
3852
|
if (environments && Object.keys(environments).length > 0) {
|
|
3885
3853
|
let resolvedEnvironments = Object.fromEntries(Object.entries(environments).filter(([name])=>isEnvironmentEnabled(name)).map(([name, config])=>[
|
|
@@ -4355,7 +4323,7 @@ function getSwcMinimizerOptions(config, jsOptions) {
|
|
|
4355
4323
|
return (options.minimizerOptions.format.asciiOnly = 'ascii' === config.output.charset, jsOptions) ? cjs_default()(options, jsOptions) : options;
|
|
4356
4324
|
}
|
|
4357
4325
|
function parseMinifyOptions(config) {
|
|
4358
|
-
let isProd = 'production' === config.mode, { minify =
|
|
4326
|
+
let isProd = 'production' === config.mode, { minify = !0 } = config.output;
|
|
4359
4327
|
if ('boolean' == typeof minify) {
|
|
4360
4328
|
let shouldMinify = minify && isProd;
|
|
4361
4329
|
return {
|
|
@@ -7246,7 +7214,9 @@ function prepareWatchOptions(paths, options = {}, type) {
|
|
|
7246
7214
|
}
|
|
7247
7215
|
let GLOB_REGEX = /[*?{}[\]()!+|]/;
|
|
7248
7216
|
async function createChokidar(pathOrGlobs, root, options) {
|
|
7249
|
-
let
|
|
7217
|
+
let { default: chokidar } = await import("./chokidar.js").then((mod)=>({
|
|
7218
|
+
default: mod.chokidar
|
|
7219
|
+
})), watchFiles = new Set(), globPatterns = pathOrGlobs.filter((pathOrGlob)=>!!GLOB_REGEX.test(pathOrGlob) || (watchFiles.add(pathOrGlob), !1));
|
|
7250
7220
|
if (globPatterns.length) {
|
|
7251
7221
|
let { glob } = await import("./tinyglobby.js").then((mod)=>({
|
|
7252
7222
|
glob: mod.glob
|
|
@@ -7583,13 +7553,6 @@ function applyDefaultPlugins(pluginManager, context) {
|
|
|
7583
7553
|
javascript: {
|
|
7584
7554
|
typeReexportsPresence: 'tolerant'
|
|
7585
7555
|
}
|
|
7586
|
-
}), chain.experiments({
|
|
7587
|
-
...chain.get('experiments'),
|
|
7588
|
-
rspackFuture: {
|
|
7589
|
-
bundlerInfo: {
|
|
7590
|
-
force: !1
|
|
7591
|
-
}
|
|
7592
|
-
}
|
|
7593
7556
|
});
|
|
7594
7557
|
});
|
|
7595
7558
|
}
|
|
@@ -7650,17 +7613,14 @@ function applyDefaultPlugins(pluginManager, context) {
|
|
|
7650
7613
|
if (!1 === buildCache) return;
|
|
7651
7614
|
cacheEnabled = !0;
|
|
7652
7615
|
let { context } = api, cacheConfig = 'boolean' == typeof buildCache ? {} : buildCache, cacheDirectory = getCacheDirectory(cacheConfig, context), buildDependencies = await getBuildDependencies(context, config, environment, cacheConfig.buildDependencies), cacheVersion = Array.isArray(cacheConfig.cacheDigest) && cacheConfig.cacheDigest.length ? `${environment.name}-${env}-${await helpers_hash(JSON.stringify(cacheConfig.cacheDigest))}` : `${environment.name}-${env}`;
|
|
7653
|
-
chain.cache(
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
},
|
|
7662
|
-
buildDependencies: Object.values(buildDependencies).flat()
|
|
7663
|
-
}
|
|
7616
|
+
chain.cache({
|
|
7617
|
+
type: 'persistent',
|
|
7618
|
+
version: cacheVersion,
|
|
7619
|
+
storage: {
|
|
7620
|
+
type: 'filesystem',
|
|
7621
|
+
directory: cacheDirectory
|
|
7622
|
+
},
|
|
7623
|
+
buildDependencies: Object.values(buildDependencies).flat()
|
|
7664
7624
|
});
|
|
7665
7625
|
}), api.onAfterCreateCompiler(()=>{
|
|
7666
7626
|
cacheEnabled && src_logger.debug('Rspack persistent cache enabled');
|
|
@@ -7707,7 +7667,9 @@ function applyDefaultPlugins(pluginManager, context) {
|
|
|
7707
7667
|
} : external_node_path_.posix.join(jsPath, jsFilename)).chunkFilename(isJsFilenameFn ? (...args)=>{
|
|
7708
7668
|
let name = jsFilename(...args);
|
|
7709
7669
|
return external_node_path_.posix.join(jsAsyncPath, name);
|
|
7710
|
-
} : external_node_path_.posix.join(jsAsyncPath, jsFilename)).publicPath(publicPath)
|
|
7670
|
+
} : external_node_path_.posix.join(jsAsyncPath, jsFilename)).publicPath(publicPath).bundlerInfo({
|
|
7671
|
+
force: !1
|
|
7672
|
+
}), isServer && chain.output.library({
|
|
7711
7673
|
type: 'commonjs2',
|
|
7712
7674
|
...chain.output.get('library') || {}
|
|
7713
7675
|
}), config.output.copy) {
|
|
@@ -8071,20 +8033,6 @@ function applyDefaultPlugins(pluginManager, context) {
|
|
|
8071
8033
|
});
|
|
8072
8034
|
}
|
|
8073
8035
|
},
|
|
8074
|
-
{
|
|
8075
|
-
name: 'rsbuild:moment',
|
|
8076
|
-
setup (api) {
|
|
8077
|
-
api.modifyBundlerChain((chain, { environment, bundler })=>{
|
|
8078
|
-
let { config } = environment;
|
|
8079
|
-
config.performance.removeMomentLocale && chain.plugin('remove-moment-locale').use(bundler.IgnorePlugin, [
|
|
8080
|
-
{
|
|
8081
|
-
resourceRegExp: /^\.\/locale$/,
|
|
8082
|
-
contextRegExp: /moment$/
|
|
8083
|
-
}
|
|
8084
|
-
]);
|
|
8085
|
-
});
|
|
8086
|
-
}
|
|
8087
|
-
},
|
|
8088
8036
|
{
|
|
8089
8037
|
name: 'rsbuild:node-addons',
|
|
8090
8038
|
setup (api) {
|
|
@@ -8294,7 +8242,7 @@ try {
|
|
|
8294
8242
|
minimizerOptions: {
|
|
8295
8243
|
targets: isPlainObject(loaderOptions.targets) ? environment.browserslist : loaderOptions.targets,
|
|
8296
8244
|
...pick(loaderOptions, [
|
|
8297
|
-
'
|
|
8245
|
+
'drafts',
|
|
8298
8246
|
'include',
|
|
8299
8247
|
'exclude',
|
|
8300
8248
|
'nonStandard',
|
|
@@ -8637,7 +8585,7 @@ try {
|
|
|
8637
8585
|
api.modifyBundlerChain(async (chain, { CHAIN_ID, environment, isDev })=>{
|
|
8638
8586
|
let { output: { manifest }, dev: { writeToDisk } } = environment.config;
|
|
8639
8587
|
if (!1 === manifest) return;
|
|
8640
|
-
let manifestOptions = normalizeManifestObjectConfig(manifest), { RspackManifestPlugin } = await import("./manifest-plugin.js").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.
|
|
8588
|
+
let manifestOptions = normalizeManifestObjectConfig(manifest), { RspackManifestPlugin } = await import("./manifest-plugin.js").then(__webpack_require__.bind(__webpack_require__, "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-alpha.0_@module-federation+runtime-tools@0.22.1_@swc+helpers@0.5.18_/node_modules/rspack-manifest-plugin/dist/index.js")), { htmlPaths } = environment, filter = manifestOptions.filter ?? ((file)=>!file.name.endsWith('.LICENSE.txt'));
|
|
8641
8589
|
manifestFilenames.set(environment.name, manifestOptions.filename);
|
|
8642
8590
|
let pluginOptions = {
|
|
8643
8591
|
fileName: manifestOptions.filename,
|
|
@@ -9146,7 +9094,7 @@ let applyServerOptions = (command)=>{
|
|
|
9146
9094
|
};
|
|
9147
9095
|
function setupCommands() {
|
|
9148
9096
|
let cli = ((name = "")=>new CAC(name))('rsbuild');
|
|
9149
|
-
cli.version("2.0.0-alpha.
|
|
9097
|
+
cli.version("2.0.0-alpha.2"), cli.option('--base <base>', 'Set the base path of the server').option('-c, --config <config>', 'Set the configuration file (relative or absolute path)').option('--config-loader <loader>', 'Set the config file loader (auto | jiti | native)', {
|
|
9150
9098
|
default: 'auto'
|
|
9151
9099
|
}).option('--env-dir <dir>', 'Set the directory for loading `.env` files').option('--env-mode <mode>', 'Set the env mode to load the `.env.[mode]` file').option('--environment <name>', 'Set the environment name(s) to build', {
|
|
9152
9100
|
type: [
|
|
@@ -9215,7 +9163,7 @@ function initNodeEnv() {
|
|
|
9215
9163
|
}
|
|
9216
9164
|
function showGreeting() {
|
|
9217
9165
|
let { npm_execpath, npm_lifecycle_event, NODE_RUN_SCRIPT_NAME } = process.env, isBun = npm_execpath?.includes('.bun');
|
|
9218
|
-
src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.0.0-alpha.
|
|
9166
|
+
src_logger.greet(`${'npx' === npm_lifecycle_event || isBun || NODE_RUN_SCRIPT_NAME ? '\n' : ''}Rsbuild v2.0.0-alpha.2\n`);
|
|
9219
9167
|
}
|
|
9220
9168
|
function setupLogLevel() {
|
|
9221
9169
|
let logLevelIndex = process.argv.findIndex((item)=>'--log-level' === item || '--logLevel' === item);
|
|
@@ -9233,8 +9181,8 @@ function runCLI() {
|
|
|
9233
9181
|
try {
|
|
9234
9182
|
setupCommands();
|
|
9235
9183
|
} catch (err) {
|
|
9236
|
-
src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err);
|
|
9184
|
+
src_logger.error('Failed to start Rsbuild CLI.'), src_logger.error(err), process.exit(1);
|
|
9237
9185
|
}
|
|
9238
9186
|
}
|
|
9239
|
-
let src_version = "2.0.0-alpha.
|
|
9240
|
-
export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, external_node_util_promisify, loadConfig_loadConfig as loadConfig, loadEnv, mergeRsbuildConfig, node_os, node_process, rspack_rspack as rspack, runCLI, src_logger as logger, src_version as version };
|
|
9187
|
+
let src_version = "2.0.0-alpha.2";
|
|
9188
|
+
export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, external_node_os_type, external_node_util_promisify, loadConfig_loadConfig as loadConfig, loadEnv, mergeRsbuildConfig, node_os, node_process, rspack_rspack as rspack, runCLI, src_logger as logger, src_version as version };
|
package/dist/397.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as __rspack_external_node_events_0a6aefe7 from "node:events";
|
|
2
|
+
import * as __rspack_external_node_stream_444d1c2b from "node:stream";
|
|
3
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
4
|
+
__webpack_require__.add({
|
|
5
|
+
"node:events" (module) {
|
|
6
|
+
module.exports = __rspack_external_node_events_0a6aefe7;
|
|
7
|
+
},
|
|
8
|
+
"node:stream" (module) {
|
|
9
|
+
module.exports = __rspack_external_node_stream_444d1c2b;
|
|
10
|
+
}
|
|
11
|
+
});
|
package/dist/7.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { constants, default as promises, lstat, open as promises_open, readdir, realpath, stat } from "node:fs/promises";
|