@umijs/bundler-vite 4.0.0-beta.13 → 4.0.0-beta.14
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/dist/config/config.js
CHANGED
|
@@ -18,7 +18,7 @@ const plugins_1 = __importDefault(require("../plugins"));
|
|
|
18
18
|
const transformer_1 = __importDefault(require("./transformer"));
|
|
19
19
|
function getConfig(opts) {
|
|
20
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
const applyOpts = Object.assign(Object.assign({}, opts.userConfig), { extraBabelPlugins: [
|
|
21
|
+
const applyOpts = Object.assign(Object.assign({}, opts.userConfig), { entry: opts.entry, extraBabelPlugins: [
|
|
22
22
|
...(opts.extraBabelPlugins || []),
|
|
23
23
|
...(opts.userConfig.extraBabelPlugins || []),
|
|
24
24
|
], extraBabelPresets: [
|
|
@@ -23,7 +23,14 @@ exports.default = (function css(userConfig) {
|
|
|
23
23
|
css: { postcss: {}, preprocessorOptions: {} },
|
|
24
24
|
resolve: {
|
|
25
25
|
alias: [
|
|
26
|
-
// to
|
|
26
|
+
// to support less-loader ~ for alias deps
|
|
27
|
+
...Object.entries(userConfig.alias)
|
|
28
|
+
.filter(([_, target]) => target.includes('node_modules'))
|
|
29
|
+
.map(([dep, target]) => ({
|
|
30
|
+
find: `~${dep}`,
|
|
31
|
+
replacement: target,
|
|
32
|
+
})),
|
|
33
|
+
// to support less-loader ~ for local deps, refer: https://github.com/vitejs/vite/issues/2185
|
|
27
34
|
{ find: /^~/, replacement: '' },
|
|
28
35
|
],
|
|
29
36
|
},
|
|
@@ -4,7 +4,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
* transform user config to vite optimizeDeps config
|
|
5
5
|
*/
|
|
6
6
|
exports.default = (function optimizeDeps(userConfig) {
|
|
7
|
-
const config = {
|
|
7
|
+
const config = {
|
|
8
|
+
// configure pre-bundling entries
|
|
9
|
+
optimizeDeps: { entries: Object.values(userConfig.entry) },
|
|
10
|
+
};
|
|
8
11
|
// include alias which within node_modules for optimize dependencies
|
|
9
12
|
if (typeof userConfig.alias === 'object') {
|
|
10
13
|
config.optimizeDeps.include = Object.keys(userConfig.alias).filter((name) => userConfig.alias[name].includes('node_modules'));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/bundler-vite",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.14",
|
|
4
4
|
"description": "@umijs/bundler-vite",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi-next/tree/master/packages/bundler-vite#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi-next/issues",
|
|
@@ -25,15 +25,15 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@svgr/core": "6.0.0",
|
|
28
|
-
"@umijs/bundler-utils": "4.0.0-beta.
|
|
29
|
-
"@umijs/utils": "4.0.0-beta.
|
|
28
|
+
"@umijs/bundler-utils": "4.0.0-beta.14",
|
|
29
|
+
"@umijs/utils": "4.0.0-beta.14",
|
|
30
30
|
"@vitejs/plugin-legacy": "1.6.3",
|
|
31
31
|
"@vitejs/plugin-react": "1.1.0",
|
|
32
32
|
"postcss-preset-env": "7.0.1",
|
|
33
33
|
"rollup-plugin-copy": "3.4.0",
|
|
34
34
|
"rollup-plugin-polyfill": "3.0.0",
|
|
35
35
|
"rollup-plugin-visualizer": "5.5.2",
|
|
36
|
-
"vite": "2.6
|
|
36
|
+
"vite": "2.7.6"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"express": "4.17.1"
|