chore: 容器框架升级,修复项目命令行异常问题
This commit is contained in:
9
packages/web-vitals/farm.config.ts
Normal file
9
packages/web-vitals/farm.config.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { defineConfig } from "@farmfe/core";
|
||||
|
||||
export default defineConfig({
|
||||
compilation: {
|
||||
input: {
|
||||
index: "./src/index.ts",
|
||||
},
|
||||
},
|
||||
});
|
||||
28
packages/web-vitals/package.json
Normal file
28
packages/web-vitals/package.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"name": "@sy/web-vitals",
|
||||
"version": "0.0.1",
|
||||
"description": "web vitals",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "farm build",
|
||||
"clean:lock": "rimraf pnpm-lock.yaml && rimraf package.lock.json",
|
||||
"clean": "rimraf node_modules"
|
||||
},
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.js",
|
||||
"require": "./dist/index.js"
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"firebase": "^11.3.1",
|
||||
"web-vitals": "^4.2.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@farmfe/cli": "^1.0.4",
|
||||
"@farmfe/core": "^1.6.6"
|
||||
}
|
||||
}
|
||||
19
packages/web-vitals/src/index.ts
Normal file
19
packages/web-vitals/src/index.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { onLCP, onINP, onCLS } from "web-vitals";
|
||||
// import { initializeApp } from "firebase/app";
|
||||
// import { getAnalytics } from "firebase/analytics";
|
||||
|
||||
// // TODO: Replace the following with your app's Firebase project configuration
|
||||
// // See: https://firebase.google.com/docs/web/learn-more#config-object
|
||||
// const firebaseConfig = {
|
||||
// // ...
|
||||
// };
|
||||
|
||||
// // Initialize Firebase
|
||||
// const app = initializeApp(firebaseConfig);
|
||||
|
||||
// // Initialize Analytics and get a reference to the service
|
||||
// const analytics = getAnalytics(app);
|
||||
|
||||
onCLS(console.log);
|
||||
onINP(console.log);
|
||||
onLCP(console.log);
|
||||
12
packages/web-vitals/tsconfig.json
Normal file
12
packages/web-vitals/tsconfig.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"module": "ESNext",
|
||||
"outDir": "dist",
|
||||
"declaration": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
"useUnknownInCatchVariables": false
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user