metaowl 0.2.4 → 0.2.6

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/vite/plugin.js +5 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metaowl",
3
- "version": "0.2.4",
3
+ "version": "0.2.6",
4
4
  "description": "Lightweight meta-framework for Odoo OWL — file-based routing, app mounting, Fetch helper, Cache, Meta tags, SSG generator, and a Vite plugin.",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/vite/plugin.js CHANGED
@@ -134,7 +134,7 @@ export async function metaowlPlugin(options = {}) {
134
134
  'process.env': safeEnv
135
135
  }
136
136
 
137
- cfg.root = cfg.root ?? root
137
+ cfg.root = cfg.root ?? resolve(process.cwd(), root)
138
138
  cfg.publicDir = cfg.publicDir ?? publicDir
139
139
  cfg.appType = cfg.appType ?? 'spa'
140
140
 
@@ -154,7 +154,7 @@ export async function metaowlPlugin(options = {}) {
154
154
  chunkSizeWarningLimit: 1024,
155
155
  target: 'esnext',
156
156
  rollupOptions: {
157
- input: 'index.html',
157
+ input: resolve(process.cwd(), root, 'index.html'),
158
158
  output: {
159
159
  manualChunks: {
160
160
  vendor: vendorPackages,
@@ -254,12 +254,13 @@ export async function metaowlPlugin(options = {}) {
254
254
  * @param {*} [options.*] - All other options forwarded to metaowlPlugin().
255
255
  * @returns {import('vite').UserConfig}
256
256
  */
257
- export function metaowlConfig(options = {}) {
257
+ export async function metaowlConfig(options = {}) {
258
258
  const { server, preview, build, ...metaowlOptions } = options
259
+ const plugins = await metaowlPlugin(metaowlOptions)
259
260
  return {
260
261
  server: { port: 3000, strictPort: true, host: true, ...server },
261
262
  preview: { port: 4173, strictPort: true, ...preview },
262
263
  ...(build ? { build } : {}),
263
- plugins: [metaowlPlugin(metaowlOptions)]
264
+ plugins
264
265
  }
265
266
  }