Skip to content

Commit fde53d1

Browse files
Add exported meta object (#190)
* add meta object * fix: lint error * fix: fix path and write comment * chore: add plugin * set version with replacing
1 parent 36a4929 commit fde53d1

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

Diff for: package.json

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"rimraf": "^3.0.2",
5757
"rollup": "^2.60.0",
5858
"rollup-plugin-node-resolve": "^5.2.0",
59+
"rollup-plugin-replace": "^2.2.0",
5960
"rollup-plugin-sourcemaps": "^0.6.3",
6061
"ts-node": "^10.4.0",
6162
"typescript": "~4.8.4",

Diff for: rollup.config.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66
import resolve from "rollup-plugin-node-resolve"
77
import sourcemaps from "rollup-plugin-sourcemaps"
8+
import replace from "rollup-plugin-replace"
89

910
const pkg = require("./package.json")
1011
const deps = new Set(
@@ -23,6 +24,12 @@ export default {
2324
* See LICENSE file in root directory for full license.
2425
*/`,
2526
},
26-
plugins: [sourcemaps(), resolve()],
27+
plugins: [
28+
sourcemaps(),
29+
resolve(),
30+
replace({
31+
"process.env.PACKAGE_VERSION": `"${pkg.version}"`,
32+
}),
33+
],
2734
external: id => deps.has(id) || id.startsWith("lodash"),
2835
}

Diff for: src/index.ts

+6
Original file line numberDiff line numberDiff line change
@@ -208,3 +208,9 @@ function parseAsScript(code: string, options: ParserOptions) {
208208
}),
209209
})
210210
}
211+
212+
export const meta = {
213+
name: "vue-eslint-parser",
214+
// eslint-disable-next-line no-process-env
215+
version: process.env.PACKAGE_VERSION,
216+
}

0 commit comments

Comments
 (0)