@evjs/create-app 0.0.16 → 0.0.17
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/package.json +1 -1
- package/templates/basic-csr/package.json +1 -1
- package/templates/basic-server-fns/package.json +1 -1
- package/templates/basic-server-routes/package.json +1 -1
- package/templates/complex-routing/package.json +1 -1
- package/templates/configured-server-fns/README.md +1 -0
- package/templates/configured-server-fns/ev.config.ts +12 -10
- package/templates/configured-server-fns/package.json +1 -1
- package/templates/with-tailwind/package.json +1 -1
package/package.json
CHANGED
|
@@ -19,6 +19,7 @@ npm run dev -w example-configured-server-fns
|
|
|
19
19
|
## What It Demonstrates
|
|
20
20
|
|
|
21
21
|
- `ev.config.ts` with `defineConfig` for custom ports
|
|
22
|
+
- Plugin with `setup()` → `bundler: webpack(...)` for type-safe webpack config
|
|
22
23
|
- `useQuery(getUsers)` for fetching data with auto-generated keys
|
|
23
24
|
- `useMutation({ mutationFn })` with `getUsers.queryKey()` for cache invalidation
|
|
24
25
|
- Direct mutation args: `mutate({ name, email })` (not array-wrapped)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { webpack } from "@evjs/bundler-webpack";
|
|
1
2
|
import { defineConfig } from "@evjs/cli";
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -37,19 +38,20 @@ export default defineConfig({
|
|
|
37
38
|
},
|
|
38
39
|
},
|
|
39
40
|
|
|
40
|
-
// Build-time plugins
|
|
41
|
+
// Build-time plugins
|
|
41
42
|
plugins: [
|
|
42
43
|
{
|
|
43
44
|
name: "example-txt-plugin",
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
setup() {
|
|
46
|
+
return {
|
|
47
|
+
// Type-safe webpack config via helper
|
|
48
|
+
bundler: webpack((config) => {
|
|
49
|
+
config.module?.rules?.push({
|
|
50
|
+
test: /\.txt$/,
|
|
51
|
+
use: "raw-loader",
|
|
52
|
+
});
|
|
53
|
+
}),
|
|
54
|
+
};
|
|
53
55
|
},
|
|
54
56
|
},
|
|
55
57
|
],
|