vite-plugin-solid
Advanced tools
Comparing version 1.3.1 to 1.3.2
@@ -25,3 +25,7 @@ 'use strict'; | ||
replacement: 'solid-js/dev' | ||
}] : []; | ||
}] : []; // TODO: remove when fully removed from vite | ||
userConfig.alias = normalizeAliases(userConfig.alias); | ||
if (!userConfig.resolve) userConfig.resolve = {}; | ||
userConfig.resolve.alias = normalizeAliases(userConfig.resolve?.alias); | ||
return mergeAnything.mergeAndConcat(userConfig, { | ||
@@ -108,4 +112,17 @@ /** | ||
} | ||
/** | ||
* This basically normalize all aliases of the config into | ||
* the array format of the alias. | ||
* | ||
* eg: alias: { '@': 'src/' } => [{ find: '@', replacement: 'src/' }] | ||
*/ | ||
function normalizeAliases(alias = []) { | ||
return Array.isArray(alias) ? alias : Object.entries(alias).map(([find, replacement]) => ({ | ||
find, | ||
replacement | ||
})); | ||
} | ||
module.exports = solidPlugin; | ||
//# sourceMappingURL=index.js.map |
@@ -23,3 +23,7 @@ import { readFileSync } from 'fs'; | ||
replacement: 'solid-js/dev' | ||
}] : []; | ||
}] : []; // TODO: remove when fully removed from vite | ||
userConfig.alias = normalizeAliases(userConfig.alias); | ||
if (!userConfig.resolve) userConfig.resolve = {}; | ||
userConfig.resolve.alias = normalizeAliases(userConfig.resolve?.alias); | ||
return mergeAndConcat(userConfig, { | ||
@@ -106,4 +110,17 @@ /** | ||
} | ||
/** | ||
* This basically normalize all aliases of the config into | ||
* the array format of the alias. | ||
* | ||
* eg: alias: { '@': 'src/' } => [{ find: '@', replacement: 'src/' }] | ||
*/ | ||
function normalizeAliases(alias = []) { | ||
return Array.isArray(alias) ? alias : Object.entries(alias).map(([find, replacement]) => ({ | ||
find, | ||
replacement | ||
})); | ||
} | ||
export default solidPlugin; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "vite-plugin-solid", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"description": "solid-js integration plugin for vite 2", | ||
@@ -5,0 +5,0 @@ "files": ["dist"], |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
40897
225