oc-template-preact-compiler 0.0.5 → 0.0.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.
@@ -33,11 +33,14 @@ async function compileServer(options) {
33
33
  try {
34
34
  await fs.outputFile(higherOrderServerPath, higherOrderServerContent);
35
35
 
36
+ const baseConfig = await vite.loadConfigFromFile(process.cwd()).catch(() => null);
37
+ const basePlugins = baseConfig?.config?.plugins ?? [];
38
+
36
39
  const result = await vite.build({
37
40
  appType: 'custom',
38
41
  root: componentPath,
39
42
  mode: production ? 'production' : 'development',
40
- plugins: options.plugins,
43
+ plugins: [...options.plugins, ...basePlugins],
41
44
  logLevel: options.verbose ? 'info' : 'silent',
42
45
  build: {
43
46
  lib: { entry: higherOrderServerPath, formats: ['cjs'] },
@@ -56,11 +56,14 @@ async function compileView(options) {
56
56
  return externals;
57
57
  }, {});
58
58
 
59
+ const baseConfig = await vite.loadConfigFromFile(process.cwd()).catch(() => null);
60
+ const basePlugins = baseConfig?.config?.plugins ?? [];
61
+
59
62
  const result = await vite.build({
60
63
  appType: 'custom',
61
64
  root: componentPath,
62
65
  mode: production ? 'production' : 'development',
63
- plugins: [...options.plugins, EnvironmentPlugin(['NODE_ENV']), cssModules()],
66
+ plugins: [...options.plugins, EnvironmentPlugin(['NODE_ENV']), cssModules(), ...basePlugins],
64
67
  logLevel: 'silent',
65
68
  build: {
66
69
  sourcemap: !production,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oc-template-preact-compiler",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -20,9 +20,9 @@
20
20
  },
21
21
  "parameters": {
22
22
  "userId": {
23
- "default": 0,
23
+ "default": 1,
24
24
  "description": "The user id from the user database",
25
- "example": 0,
25
+ "example": 1,
26
26
  "mandatory": true,
27
27
  "type": "number"
28
28
  }
@@ -34,7 +34,7 @@
34
34
  "@testing-library/user-event": "^14.4.3",
35
35
  "jsdom": "^21.1.1",
36
36
  "oc-template-preact": "0.0.2",
37
- "oc-template-preact-compiler": "0.0.5",
37
+ "oc-template-preact-compiler": "0.0.7",
38
38
  "preact": "^10.13.2",
39
39
  "typescript": "5.0.2",
40
40
  "vitest": "^0.29.7"