veslx 0.0.19 → 0.0.21

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/bin/lib/serve.ts CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- import { createServer } from 'vite'
2
+ import { createServer, preview } from 'vite'
3
3
  import importConfig from "./import-config";
4
4
  import veslxPlugin from '../../plugin/src/plugin'
5
5
  import path from 'path'
@@ -39,28 +39,25 @@ export default async function start() {
39
39
  const veslxRoot = new URL('../..', import.meta.url).pathname;
40
40
  const nodeModulesDir = findNodeModulesDir(veslxRoot)
41
41
 
42
- const server = await createServer({
42
+ const server = await preview({
43
43
  root: veslxRoot,
44
44
  configFile: new URL('../../vite.config.ts', import.meta.url).pathname,
45
45
  plugins: [
46
46
  veslxPlugin(config.dir)
47
47
  ],
48
- optimizeDeps: {
49
- force: true,
50
- },
51
- resolve: {
52
- // Tell Vite to look for modules in the found node_modules directory
53
- modules: [nodeModulesDir, 'node_modules'],
54
- },
55
- server: {
56
- fs: {
57
- // Allow serving from the parent node_modules
58
- allow: [veslxRoot, nodeModulesDir, cwd],
59
- },
60
- },
48
+ // resolve: {
49
+ // // Tell Vite to look for modules in the found node_modules directory
50
+ // modules: [nodeModulesDir, 'node_modules'],
51
+ // },
52
+ // server: {
53
+ // fs: {
54
+ // // Allow serving from the parent node_modules
55
+ // allow: [veslxRoot, nodeModulesDir, cwd],
56
+ // },
57
+ // },
61
58
  })
62
59
 
63
- await server.listen()
60
+ // await server.listen()
64
61
 
65
62
  server.printUrls()
66
63
  server.bindCLIShortcuts({ print: true })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veslx",
3
- "version": "0.0.19",
3
+ "version": "0.0.21",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "veslx": "bin/veslx.ts"
package/vite.config.ts CHANGED
@@ -50,6 +50,12 @@ export default defineConfig({
50
50
  allowedHosts: true,
51
51
  },
52
52
  preview: {
53
+ host: '0.0.0.0',
54
+ port: process.env.PORT ? parseInt(process.env.PORT, 10) : 3000,
55
+ strictPort: true,
56
+ fs: {
57
+ allow: ['..', '../..'],
58
+ },
53
59
  allowedHosts: true,
54
60
  },
55
61
  build: {
@@ -82,6 +88,8 @@ export default defineConfig({
82
88
  'bail',
83
89
  'trough',
84
90
  'vfile',
91
+ 'format',
92
+ 'fault',
85
93
  ],
86
94
  },
87
95
  })