sygnal 5.3.6 → 5.3.7

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.
@@ -31,16 +31,23 @@ function sygnal(options = {}) {
31
31
  name: 'vite-plugin-sygnal',
32
32
  config(_config, env) {
33
33
  isServe = env.command === 'serve';
34
- if (disableJsx)
35
- return;
36
- return {
37
- oxc: {
34
+ const config = {
35
+ // Ensure sygnal is bundled for SSR rather than externalized.
36
+ // Without this, Node fails to resolve sygnal's exports from
37
+ // Vike's server chunks in production builds.
38
+ ssr: {
39
+ noExternal: ['sygnal'],
40
+ },
41
+ };
42
+ if (!disableJsx) {
43
+ config.oxc = {
38
44
  jsx: {
39
45
  runtime: 'automatic',
40
46
  importSource: 'sygnal',
41
47
  },
42
- },
43
- };
48
+ };
49
+ }
50
+ return config;
44
51
  },
45
52
  transform(code, id) {
46
53
  if (disableHmr)
@@ -29,16 +29,23 @@ function sygnal(options = {}) {
29
29
  name: 'vite-plugin-sygnal',
30
30
  config(_config, env) {
31
31
  isServe = env.command === 'serve';
32
- if (disableJsx)
33
- return;
34
- return {
35
- oxc: {
32
+ const config = {
33
+ // Ensure sygnal is bundled for SSR rather than externalized.
34
+ // Without this, Node fails to resolve sygnal's exports from
35
+ // Vike's server chunks in production builds.
36
+ ssr: {
37
+ noExternal: ['sygnal'],
38
+ },
39
+ };
40
+ if (!disableJsx) {
41
+ config.oxc = {
36
42
  jsx: {
37
43
  runtime: 'automatic',
38
44
  importSource: 'sygnal',
39
45
  },
40
- },
41
- };
46
+ };
47
+ }
48
+ return config;
42
49
  },
43
50
  transform(code, id) {
44
51
  if (disableHmr)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sygnal",
3
- "version": "5.3.6",
3
+ "version": "5.3.7",
4
4
  "description": "An intuitive framework for building fast and small components or applications based on Cycle.js",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "types": "./dist/index.d.ts",
@@ -49,16 +49,25 @@ export default function sygnal(options: SygnalPluginOptions = {}) {
49
49
  config(_config: any, env: { command: string }) {
50
50
  isServe = env.command === 'serve'
51
51
 
52
- if (disableJsx) return
52
+ const config: any = {
53
+ // Ensure sygnal is bundled for SSR rather than externalized.
54
+ // Without this, Node fails to resolve sygnal's exports from
55
+ // Vike's server chunks in production builds.
56
+ ssr: {
57
+ noExternal: ['sygnal'],
58
+ },
59
+ }
53
60
 
54
- return {
55
- oxc: {
61
+ if (!disableJsx) {
62
+ config.oxc = {
56
63
  jsx: {
57
64
  runtime: 'automatic' as const,
58
65
  importSource: 'sygnal',
59
66
  },
60
- },
67
+ }
61
68
  }
69
+
70
+ return config
62
71
  },
63
72
 
64
73
  transform(code: string, id: string) {