Skip to content

Commit

Permalink
feat: add size report for compiler vapor
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Nov 26, 2023
1 parent f9c607d commit 0867ca0
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 33 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"build-dts": "tsc -p tsconfig.build.json && rollup -c rollup.dts.config.js",
"clean": "rimraf packages/*/dist temp .eslintcache",
"size": "run-s \"size-*\" && tsx scripts/usage-size.ts",
"size-global": "node scripts/build.js vue runtime-dom -f global -p --size",
"size-global": "node scripts/build.js vue runtime-dom compiler-dom compiler-vapor -f global -p --size",
"size-esm-runtime": "node scripts/build.js vue -f esm-bundler-runtime",
"size-esm": "node scripts/build.js runtime-dom runtime-vapor runtime-core reactivity shared -f esm-bundler",
"check": "tsc --incremental --noEmit",
Expand Down
7 changes: 7 additions & 0 deletions packages/compiler-vapor/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict'

if (process.env.NODE_ENV === 'production') {
module.exports = require('./dist/compiler-vapor.cjs.prod.js')
} else {
module.exports = require('./dist/compiler-vapor.cjs.js')
}
27 changes: 16 additions & 11 deletions packages/compiler-vapor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,26 @@
"name": "@vue/compiler-vapor",
"version": "0.0.0",
"description": "@vue/compiler-vapor",
"main": "dist/compiler-vapor.cjs.js",
"main": "index.js",
"module": "dist/compiler-vapor.esm-bundler.js",
"types": "dist/compiler-vapor.d.ts",
"unpkg": "dist/compiler-vapor.global.js",
"jsdelivr": "dist/compiler-vapor.global.js",
"files": [
"index.js",
"dist"
],
"sideEffects": false,
"buildOptions": {
"name": "VueCompilerVapor",
"compat": true,
"formats": [
"cjs"
],
"prod": false
"esm-bundler",
"esm-browser",
"cjs",
"global"
]
},
"types": "dist/compiler-vapor.d.ts",
"repository": {
"type": "git",
"url": "git+https://github.com/vuejs/core-vapor.git",
Expand All @@ -26,13 +35,9 @@
"bugs": {
"url": "https://github.com/vuejs/core-vapor/issues"
},
"homepage": "https://github.com/vuejs/core-vapor/tree/dev/packages/compiler-vapor#readme",
"homepage": "https://github.com/vuejs/core-vapor/tree/main/packages/compiler-vapor#readme",
"dependencies": {
"@vue/shared": "3.3.8",
"@vue/compiler-dom": "3.3.8",
"ast-kit": "^0.11.2"
},
"devDependencies": {
"@babel/types": "^7.23.0"
"@vue/compiler-dom": "3.3.8"
}
}
2 changes: 1 addition & 1 deletion packages/compiler-vapor/src/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function createRootContext(
node,
parent: null,
index: 0,
root: undefined as any, // set later
root: null!, // set later
options,
dynamic: ir.dynamic,
once: false,
Expand Down
60 changes: 40 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0867ca0

Please sign in to comment.