Skip to content

Commit

Permalink
Add exported meta object (#190)
Browse files Browse the repository at this point in the history
* add meta object

* fix: lint error

* fix: fix path and write comment

* chore: add plugin

* set version with replacing
  • Loading branch information
TatsuyaYamamoto authored Apr 28, 2023
1 parent 36a4929 commit fde53d1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"rimraf": "^3.0.2",
"rollup": "^2.60.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-sourcemaps": "^0.6.3",
"ts-node": "^10.4.0",
"typescript": "~4.8.4",
Expand Down
9 changes: 8 additions & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
*/
import resolve from "rollup-plugin-node-resolve"
import sourcemaps from "rollup-plugin-sourcemaps"
import replace from "rollup-plugin-replace"

const pkg = require("./package.json")
const deps = new Set(
Expand All @@ -23,6 +24,12 @@ export default {
* See LICENSE file in root directory for full license.
*/`,
},
plugins: [sourcemaps(), resolve()],
plugins: [
sourcemaps(),
resolve(),
replace({
"process.env.PACKAGE_VERSION": `"${pkg.version}"`,
}),
],
external: id => deps.has(id) || id.startsWith("lodash"),
}
6 changes: 6 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,9 @@ function parseAsScript(code: string, options: ParserOptions) {
}),
})
}

export const meta = {
name: "vue-eslint-parser",
// eslint-disable-next-line no-process-env
version: process.env.PACKAGE_VERSION,
}

0 comments on commit fde53d1

Please sign in to comment.