Skip to content

feat: support farm #169

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 25 commits into from
Apr 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions examples/farm/farm.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from '@farmfe/core'
import Vue from 'unplugin-vue/farm'

export default defineConfig({
plugins: [Vue()],
compilation: {
progress: false,
persistentCache: false,
},
})
16 changes: 16 additions & 0 deletions examples/farm/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/svg+xml" href="/favicon.ico" />
<title>Farm + Vue3 + TS</title>
</head>

<body>
<div id="app"></div>
<script src="./src/main.ts"></script>
</body>

</html>
20 changes: 20 additions & 0 deletions examples/farm/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "farm-vue",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "farm start",
"start": "farm start",
"build": "farm build",
"preview": "farm preview",
"clean": "farm clean"
},
"dependencies": {
"vue": "^3.4.0"
},
"devDependencies": {
"@farmfe/cli": "2.0.0-nightly-20250411100807",
"core-js": "^3.30.1",
"unplugin-vue": "workspace:*"
}
}
Binary file added examples/farm/public/favicon.ico
Binary file not shown.
12 changes: 12 additions & 0 deletions examples/farm/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script setup lang="ts">
import { ref } from 'vue'
const msg = ref('')
</script>

<template>
<div>
<h1>Hello world</h1>
<h2>{{ msg }}</h2>
<input v-model="msg" type="text" />
</div>
</template>
4 changes: 4 additions & 0 deletions examples/farm/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { createApp } from 'vue'
import App from './App.vue'

createApp(App).mount('#app')
24 changes: 24 additions & 0 deletions examples/farm/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"skipLibCheck": true,

/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve",

/* Linting */
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"],
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"./rollup": "./dist/rollup.js",
"./rolldown": "./dist/rolldown.js",
"./esbuild": "./dist/esbuild.js",
"./farm": "./dist/farm.js",
"./api": "./dist/api.js",
"./*": "./*"
},
Expand Down Expand Up @@ -70,6 +71,7 @@
},
"devDependencies": {
"@babel/types": "^7.27.0",
"@farmfe/core": "2.0.0-nightly-20250411141103",
"@jridgewell/gen-mapping": "^0.3.8",
"@jridgewell/trace-mapping": "^0.3.25",
"@sxzz/eslint-config": "^6.1.1",
Expand Down
Loading