@module-federation/vite 1.9.6 → 1.9.7
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/lib/index.cjs +38 -16
- package/lib/index.esm.js +38 -16
- package/lib/index.modern.js +38 -16
- package/lib/index.umd.js +38 -16
- package/lib/plugins/__tests__/pluginDts.test.d.ts +1 -0
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
|
@@ -1659,9 +1659,13 @@ var normalizeDevDtsOptions = function normalizeDevDtsOptions(dts, context) {
|
|
|
1659
1659
|
}, 'mfOptions.dts')(dts);
|
|
1660
1660
|
};
|
|
1661
1661
|
var logDtsError = function logDtsError(error, dtsOptions) {
|
|
1662
|
-
if (dtsOptions
|
|
1663
|
-
|
|
1662
|
+
if (dtsOptions === false) {
|
|
1663
|
+
return;
|
|
1664
1664
|
}
|
|
1665
|
+
if (typeof dtsOptions === 'object' && dtsOptions && dtsOptions.displayErrorInTerminal === false) {
|
|
1666
|
+
return;
|
|
1667
|
+
}
|
|
1668
|
+
console.error(error);
|
|
1665
1669
|
};
|
|
1666
1670
|
function pluginDts(options) {
|
|
1667
1671
|
if (options.dts === false) {
|
|
@@ -1800,12 +1804,18 @@ function pluginDts(options) {
|
|
|
1800
1804
|
generateBundle: function generateBundle() {
|
|
1801
1805
|
try {
|
|
1802
1806
|
var _temp6 = function _temp6() {
|
|
1803
|
-
var generateOptions
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1807
|
+
var generateOptions;
|
|
1808
|
+
try {
|
|
1809
|
+
generateOptions = dtsPlugin.normalizeGenerateTypesOptions({
|
|
1810
|
+
context: context,
|
|
1811
|
+
outputDir: outputDir,
|
|
1812
|
+
dtsOptions: normalizedDtsOptions,
|
|
1813
|
+
pluginOptions: dtsModuleFederationConfig
|
|
1814
|
+
});
|
|
1815
|
+
} catch (error) {
|
|
1816
|
+
logDtsError(error, normalizedDtsOptions);
|
|
1817
|
+
return;
|
|
1818
|
+
}
|
|
1809
1819
|
if (!generateOptions) {
|
|
1810
1820
|
return;
|
|
1811
1821
|
}
|
|
@@ -1825,19 +1835,31 @@ function pluginDts(options) {
|
|
|
1825
1835
|
if (!resolvedConfig) {
|
|
1826
1836
|
return Promise.resolve();
|
|
1827
1837
|
}
|
|
1828
|
-
var normalizedDtsOptions
|
|
1838
|
+
var normalizedDtsOptions;
|
|
1839
|
+
try {
|
|
1840
|
+
normalizedDtsOptions = dtsPlugin.normalizeDtsOptions(dtsModuleFederationConfig, resolvedConfig.root);
|
|
1841
|
+
} catch (error) {
|
|
1842
|
+
logDtsError(error, options.dts);
|
|
1843
|
+
return Promise.resolve();
|
|
1844
|
+
}
|
|
1829
1845
|
if (typeof normalizedDtsOptions !== 'object') {
|
|
1830
1846
|
return Promise.resolve();
|
|
1831
1847
|
}
|
|
1832
1848
|
var context = resolvedConfig.root;
|
|
1833
1849
|
var outputDir = resolveOutputDir(resolvedConfig);
|
|
1834
|
-
var consumeOptions
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1850
|
+
var consumeOptions;
|
|
1851
|
+
try {
|
|
1852
|
+
consumeOptions = dtsPlugin.normalizeConsumeTypesOptions({
|
|
1853
|
+
context: context,
|
|
1854
|
+
dtsOptions: normalizedDtsOptions,
|
|
1855
|
+
pluginOptions: dtsModuleFederationConfig
|
|
1856
|
+
});
|
|
1857
|
+
} catch (error) {
|
|
1858
|
+
logDtsError(error, normalizedDtsOptions);
|
|
1859
|
+
return Promise.resolve();
|
|
1860
|
+
}
|
|
1861
|
+
var _temp5 = function (_consumeOptions) {
|
|
1862
|
+
if ((_consumeOptions = consumeOptions) != null && (_consumeOptions = _consumeOptions.host) != null && _consumeOptions.typesOnBuild) {
|
|
1841
1863
|
var _temp3 = _catch(function () {
|
|
1842
1864
|
return Promise.resolve(dtsPlugin.consumeTypesAPI(consumeOptions)).then(function () {});
|
|
1843
1865
|
}, function (error) {
|
package/lib/index.esm.js
CHANGED
|
@@ -1635,9 +1635,13 @@ var normalizeDevDtsOptions = function normalizeDevDtsOptions(dts, context) {
|
|
|
1635
1635
|
}, 'mfOptions.dts')(dts);
|
|
1636
1636
|
};
|
|
1637
1637
|
var logDtsError = function logDtsError(error, dtsOptions) {
|
|
1638
|
-
if (dtsOptions
|
|
1639
|
-
|
|
1638
|
+
if (dtsOptions === false) {
|
|
1639
|
+
return;
|
|
1640
1640
|
}
|
|
1641
|
+
if (typeof dtsOptions === 'object' && dtsOptions && dtsOptions.displayErrorInTerminal === false) {
|
|
1642
|
+
return;
|
|
1643
|
+
}
|
|
1644
|
+
console.error(error);
|
|
1641
1645
|
};
|
|
1642
1646
|
function pluginDts(options) {
|
|
1643
1647
|
if (options.dts === false) {
|
|
@@ -1776,12 +1780,18 @@ function pluginDts(options) {
|
|
|
1776
1780
|
generateBundle: function generateBundle() {
|
|
1777
1781
|
try {
|
|
1778
1782
|
var _temp6 = function _temp6() {
|
|
1779
|
-
var generateOptions
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1783
|
+
var generateOptions;
|
|
1784
|
+
try {
|
|
1785
|
+
generateOptions = normalizeGenerateTypesOptions({
|
|
1786
|
+
context: context,
|
|
1787
|
+
outputDir: outputDir,
|
|
1788
|
+
dtsOptions: normalizedDtsOptions,
|
|
1789
|
+
pluginOptions: dtsModuleFederationConfig
|
|
1790
|
+
});
|
|
1791
|
+
} catch (error) {
|
|
1792
|
+
logDtsError(error, normalizedDtsOptions);
|
|
1793
|
+
return;
|
|
1794
|
+
}
|
|
1785
1795
|
if (!generateOptions) {
|
|
1786
1796
|
return;
|
|
1787
1797
|
}
|
|
@@ -1801,19 +1811,31 @@ function pluginDts(options) {
|
|
|
1801
1811
|
if (!resolvedConfig) {
|
|
1802
1812
|
return Promise.resolve();
|
|
1803
1813
|
}
|
|
1804
|
-
var normalizedDtsOptions
|
|
1814
|
+
var normalizedDtsOptions;
|
|
1815
|
+
try {
|
|
1816
|
+
normalizedDtsOptions = normalizeDtsOptions(dtsModuleFederationConfig, resolvedConfig.root);
|
|
1817
|
+
} catch (error) {
|
|
1818
|
+
logDtsError(error, options.dts);
|
|
1819
|
+
return Promise.resolve();
|
|
1820
|
+
}
|
|
1805
1821
|
if (typeof normalizedDtsOptions !== 'object') {
|
|
1806
1822
|
return Promise.resolve();
|
|
1807
1823
|
}
|
|
1808
1824
|
var context = resolvedConfig.root;
|
|
1809
1825
|
var outputDir = resolveOutputDir(resolvedConfig);
|
|
1810
|
-
var consumeOptions
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1826
|
+
var consumeOptions;
|
|
1827
|
+
try {
|
|
1828
|
+
consumeOptions = normalizeConsumeTypesOptions({
|
|
1829
|
+
context: context,
|
|
1830
|
+
dtsOptions: normalizedDtsOptions,
|
|
1831
|
+
pluginOptions: dtsModuleFederationConfig
|
|
1832
|
+
});
|
|
1833
|
+
} catch (error) {
|
|
1834
|
+
logDtsError(error, normalizedDtsOptions);
|
|
1835
|
+
return Promise.resolve();
|
|
1836
|
+
}
|
|
1837
|
+
var _temp5 = function (_consumeOptions) {
|
|
1838
|
+
if ((_consumeOptions = consumeOptions) != null && (_consumeOptions = _consumeOptions.host) != null && _consumeOptions.typesOnBuild) {
|
|
1817
1839
|
var _temp3 = _catch(function () {
|
|
1818
1840
|
return Promise.resolve(consumeTypesAPI(consumeOptions)).then(function () {});
|
|
1819
1841
|
}, function (error) {
|
package/lib/index.modern.js
CHANGED
|
@@ -1694,9 +1694,13 @@ const normalizeDevDtsOptions = (dts, context) => {
|
|
|
1694
1694
|
}, 'mfOptions.dts')(dts);
|
|
1695
1695
|
};
|
|
1696
1696
|
const logDtsError = (error, dtsOptions) => {
|
|
1697
|
-
if (dtsOptions
|
|
1698
|
-
|
|
1697
|
+
if (dtsOptions === false) {
|
|
1698
|
+
return;
|
|
1699
|
+
}
|
|
1700
|
+
if (typeof dtsOptions === 'object' && dtsOptions && dtsOptions.displayErrorInTerminal === false) {
|
|
1701
|
+
return;
|
|
1699
1702
|
}
|
|
1703
|
+
console.error(error);
|
|
1700
1704
|
};
|
|
1701
1705
|
function pluginDts(options) {
|
|
1702
1706
|
if (options.dts === false) {
|
|
@@ -1822,7 +1826,7 @@ function pluginDts(options) {
|
|
|
1822
1826
|
resolvedConfig = config;
|
|
1823
1827
|
},
|
|
1824
1828
|
async generateBundle() {
|
|
1825
|
-
var _consumeOptions
|
|
1829
|
+
var _consumeOptions;
|
|
1826
1830
|
if (hasGeneratedBundle) {
|
|
1827
1831
|
return;
|
|
1828
1832
|
}
|
|
@@ -1830,30 +1834,48 @@ function pluginDts(options) {
|
|
|
1830
1834
|
if (!resolvedConfig) {
|
|
1831
1835
|
return;
|
|
1832
1836
|
}
|
|
1833
|
-
|
|
1837
|
+
let normalizedDtsOptions;
|
|
1838
|
+
try {
|
|
1839
|
+
normalizedDtsOptions = normalizeDtsOptions(dtsModuleFederationConfig, resolvedConfig.root);
|
|
1840
|
+
} catch (error) {
|
|
1841
|
+
logDtsError(error, options.dts);
|
|
1842
|
+
return;
|
|
1843
|
+
}
|
|
1834
1844
|
if (typeof normalizedDtsOptions !== 'object') {
|
|
1835
1845
|
return;
|
|
1836
1846
|
}
|
|
1837
1847
|
const context = resolvedConfig.root;
|
|
1838
1848
|
const outputDir = resolveOutputDir(resolvedConfig);
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1849
|
+
let consumeOptions;
|
|
1850
|
+
try {
|
|
1851
|
+
consumeOptions = normalizeConsumeTypesOptions({
|
|
1852
|
+
context,
|
|
1853
|
+
dtsOptions: normalizedDtsOptions,
|
|
1854
|
+
pluginOptions: dtsModuleFederationConfig
|
|
1855
|
+
});
|
|
1856
|
+
} catch (error) {
|
|
1857
|
+
logDtsError(error, normalizedDtsOptions);
|
|
1858
|
+
return;
|
|
1859
|
+
}
|
|
1860
|
+
if ((_consumeOptions = consumeOptions) != null && (_consumeOptions = _consumeOptions.host) != null && _consumeOptions.typesOnBuild) {
|
|
1845
1861
|
try {
|
|
1846
1862
|
await consumeTypesAPI(consumeOptions);
|
|
1847
1863
|
} catch (error) {
|
|
1848
1864
|
logDtsError(error, normalizedDtsOptions);
|
|
1849
1865
|
}
|
|
1850
1866
|
}
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1867
|
+
let generateOptions;
|
|
1868
|
+
try {
|
|
1869
|
+
generateOptions = normalizeGenerateTypesOptions({
|
|
1870
|
+
context,
|
|
1871
|
+
outputDir,
|
|
1872
|
+
dtsOptions: normalizedDtsOptions,
|
|
1873
|
+
pluginOptions: dtsModuleFederationConfig
|
|
1874
|
+
});
|
|
1875
|
+
} catch (error) {
|
|
1876
|
+
logDtsError(error, normalizedDtsOptions);
|
|
1877
|
+
return;
|
|
1878
|
+
}
|
|
1857
1879
|
if (!generateOptions) {
|
|
1858
1880
|
return;
|
|
1859
1881
|
}
|
package/lib/index.umd.js
CHANGED
|
@@ -1654,9 +1654,13 @@
|
|
|
1654
1654
|
}, 'mfOptions.dts')(dts);
|
|
1655
1655
|
};
|
|
1656
1656
|
var logDtsError = function logDtsError(error, dtsOptions) {
|
|
1657
|
-
if (dtsOptions
|
|
1658
|
-
|
|
1657
|
+
if (dtsOptions === false) {
|
|
1658
|
+
return;
|
|
1659
1659
|
}
|
|
1660
|
+
if (typeof dtsOptions === 'object' && dtsOptions && dtsOptions.displayErrorInTerminal === false) {
|
|
1661
|
+
return;
|
|
1662
|
+
}
|
|
1663
|
+
console.error(error);
|
|
1660
1664
|
};
|
|
1661
1665
|
function pluginDts(options) {
|
|
1662
1666
|
if (options.dts === false) {
|
|
@@ -1795,12 +1799,18 @@
|
|
|
1795
1799
|
generateBundle: function generateBundle() {
|
|
1796
1800
|
try {
|
|
1797
1801
|
var _temp6 = function _temp6() {
|
|
1798
|
-
var generateOptions
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1802
|
+
var generateOptions;
|
|
1803
|
+
try {
|
|
1804
|
+
generateOptions = dtsPlugin.normalizeGenerateTypesOptions({
|
|
1805
|
+
context: context,
|
|
1806
|
+
outputDir: outputDir,
|
|
1807
|
+
dtsOptions: normalizedDtsOptions,
|
|
1808
|
+
pluginOptions: dtsModuleFederationConfig
|
|
1809
|
+
});
|
|
1810
|
+
} catch (error) {
|
|
1811
|
+
logDtsError(error, normalizedDtsOptions);
|
|
1812
|
+
return;
|
|
1813
|
+
}
|
|
1804
1814
|
if (!generateOptions) {
|
|
1805
1815
|
return;
|
|
1806
1816
|
}
|
|
@@ -1820,19 +1830,31 @@
|
|
|
1820
1830
|
if (!resolvedConfig) {
|
|
1821
1831
|
return Promise.resolve();
|
|
1822
1832
|
}
|
|
1823
|
-
var normalizedDtsOptions
|
|
1833
|
+
var normalizedDtsOptions;
|
|
1834
|
+
try {
|
|
1835
|
+
normalizedDtsOptions = dtsPlugin.normalizeDtsOptions(dtsModuleFederationConfig, resolvedConfig.root);
|
|
1836
|
+
} catch (error) {
|
|
1837
|
+
logDtsError(error, options.dts);
|
|
1838
|
+
return Promise.resolve();
|
|
1839
|
+
}
|
|
1824
1840
|
if (typeof normalizedDtsOptions !== 'object') {
|
|
1825
1841
|
return Promise.resolve();
|
|
1826
1842
|
}
|
|
1827
1843
|
var context = resolvedConfig.root;
|
|
1828
1844
|
var outputDir = resolveOutputDir(resolvedConfig);
|
|
1829
|
-
var consumeOptions
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1845
|
+
var consumeOptions;
|
|
1846
|
+
try {
|
|
1847
|
+
consumeOptions = dtsPlugin.normalizeConsumeTypesOptions({
|
|
1848
|
+
context: context,
|
|
1849
|
+
dtsOptions: normalizedDtsOptions,
|
|
1850
|
+
pluginOptions: dtsModuleFederationConfig
|
|
1851
|
+
});
|
|
1852
|
+
} catch (error) {
|
|
1853
|
+
logDtsError(error, normalizedDtsOptions);
|
|
1854
|
+
return Promise.resolve();
|
|
1855
|
+
}
|
|
1856
|
+
var _temp5 = function (_consumeOptions) {
|
|
1857
|
+
if ((_consumeOptions = consumeOptions) != null && (_consumeOptions = _consumeOptions.host) != null && _consumeOptions.typesOnBuild) {
|
|
1836
1858
|
var _temp3 = _catch(function () {
|
|
1837
1859
|
return Promise.resolve(dtsPlugin.consumeTypesAPI(consumeOptions)).then(function () {});
|
|
1838
1860
|
}, function (error) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|