@uniweb/build 0.1.15 → 0.1.17
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/package.json +1 -1
- package/src/site/config.js +31 -11
package/package.json
CHANGED
package/src/site/config.js
CHANGED
|
@@ -117,6 +117,7 @@ export function readSiteConfig(siteRoot) {
|
|
|
117
117
|
* @param {Object} [options.seo] - SEO configuration for siteContentPlugin
|
|
118
118
|
* @param {Object} [options.assets] - Asset processing configuration
|
|
119
119
|
* @param {Object} [options.search] - Search index configuration
|
|
120
|
+
* @param {boolean} [options.tailwind] - Include Tailwind CSS v4 Vite plugin (default: true)
|
|
120
121
|
* @returns {Promise<Object>} Vite configuration
|
|
121
122
|
*/
|
|
122
123
|
export async function defineSiteConfig(options = {}) {
|
|
@@ -128,6 +129,7 @@ export async function defineSiteConfig(options = {}) {
|
|
|
128
129
|
seo = {},
|
|
129
130
|
assets = {},
|
|
130
131
|
search = {},
|
|
132
|
+
tailwind = true,
|
|
131
133
|
...restOptions
|
|
132
134
|
} = options
|
|
133
135
|
|
|
@@ -146,24 +148,39 @@ export async function defineSiteConfig(options = {}) {
|
|
|
146
148
|
|
|
147
149
|
// Dynamic imports for optional peer dependencies
|
|
148
150
|
// These are imported dynamically to avoid requiring them when not needed
|
|
149
|
-
const [
|
|
150
|
-
{ default: tailwindcss },
|
|
151
|
-
{ default: react },
|
|
152
|
-
{ default: svgr },
|
|
153
|
-
{ siteContentPlugin },
|
|
154
|
-
{ foundationDevPlugin }
|
|
155
|
-
] = await Promise.all([
|
|
156
|
-
import('@tailwindcss/vite'),
|
|
151
|
+
const imports = [
|
|
157
152
|
import('@vitejs/plugin-react'),
|
|
158
153
|
import('vite-plugin-svgr'),
|
|
159
154
|
import('./plugin.js'),
|
|
160
155
|
import('../dev/plugin.js')
|
|
161
|
-
]
|
|
156
|
+
]
|
|
157
|
+
|
|
158
|
+
// Only import Tailwind v4 Vite plugin if enabled
|
|
159
|
+
if (tailwind) {
|
|
160
|
+
imports.unshift(import('@tailwindcss/vite'))
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
const modules = await Promise.all(imports)
|
|
164
|
+
|
|
165
|
+
// Extract plugins based on what was imported
|
|
166
|
+
let tailwindcss, react, svgr, siteContentPlugin, foundationDevPlugin
|
|
167
|
+
if (tailwind) {
|
|
168
|
+
tailwindcss = modules[0].default
|
|
169
|
+
react = modules[1].default
|
|
170
|
+
svgr = modules[2].default
|
|
171
|
+
siteContentPlugin = modules[3].siteContentPlugin
|
|
172
|
+
foundationDevPlugin = modules[4].foundationDevPlugin
|
|
173
|
+
} else {
|
|
174
|
+
react = modules[0].default
|
|
175
|
+
svgr = modules[1].default
|
|
176
|
+
siteContentPlugin = modules[2].siteContentPlugin
|
|
177
|
+
foundationDevPlugin = modules[3].foundationDevPlugin
|
|
178
|
+
}
|
|
162
179
|
|
|
163
180
|
// Build the plugins array
|
|
164
181
|
const plugins = [
|
|
165
182
|
// Standard plugins
|
|
166
|
-
tailwindcss(),
|
|
183
|
+
tailwind && tailwindcss(),
|
|
167
184
|
react(),
|
|
168
185
|
svgr(),
|
|
169
186
|
|
|
@@ -220,7 +237,10 @@ export async function defineSiteConfig(options = {}) {
|
|
|
220
237
|
},
|
|
221
238
|
|
|
222
239
|
server: {
|
|
223
|
-
fs: {
|
|
240
|
+
fs: {
|
|
241
|
+
// Allow parent directory for foundation sibling access
|
|
242
|
+
allow: ['..']
|
|
243
|
+
},
|
|
224
244
|
port: siteConfig.build?.port || 3000,
|
|
225
245
|
...serverOverrides
|
|
226
246
|
},
|