cayo 1.3.3 → 1.3.4

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/lib/core/bundle.js +16 -3
  2. package/package.json +1 -1
@@ -15,6 +15,15 @@ function inputOptions(input) {
15
15
  };
16
16
  }
17
17
 
18
+ function resolvePluginDefaults(overrides = {}) {
19
+ return {
20
+ browser: true,
21
+ exportConditions: ['svelte'],
22
+ extensions: ['.svelte'],
23
+ ...overrides,
24
+ }
25
+ }
26
+
18
27
  function defaultRollupPlugins() {
19
28
  return [css(), json()];
20
29
  }
@@ -39,9 +48,7 @@ export async function getDeps(input, config) {
39
48
  ],
40
49
  }),
41
50
  resolve({
42
- browser: true,
43
- exportConditions: ['svelte'],
44
- extensions: ['.svelte'],
51
+ ...resolvePluginDefaults(),
45
52
  }),
46
53
  ...defaultRollupPlugins(),
47
54
  ...userRollupPlugins(config),
@@ -78,6 +85,7 @@ export async function getDeps(input, config) {
78
85
 
79
86
  export async function build(input, config, type = 'page') {
80
87
  const template = (type === 'page' || type === 'template');
88
+ const isCayo = (type === 'cayo');
81
89
  const requiredCompilerOptions = {
82
90
  generate: template ? 'ssr' : 'dom',
83
91
  hydratable: template ? false : true,
@@ -113,6 +121,11 @@ export async function build(input, config, type = 'page') {
113
121
  },
114
122
  extensions: config.svelte.extensions,
115
123
  }),
124
+ resolve({
125
+ ...resolvePluginDefaults({
126
+ browser: isCayo, // set browser to true only if we're building a Cayo component
127
+ }),
128
+ }),
116
129
  ...defaultRollupPlugins(),
117
130
  ...userRollupPlugins(config),
118
131
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cayo",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "start": "node cayo dev --projectRoot test",