Skip to content

Commit

Permalink
fix: cannot require @vue/compiler-sfc in monorepo
Browse files Browse the repository at this point in the history
fix #14
  • Loading branch information
qmhc committed Jun 30, 2021
1 parent c0a1529 commit fd9b5c1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions example/node_modules/@vue/compiler-sfc/package.json

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
"url": "git+https://github.com/qmhc/vite-plugin-dts.git"
},
"scripts": {
"build": "tsup src/index.ts --dts --format cjs,esm",
"build": "tsup src/index.ts --dts --format cjs,esm --external @vue/compiler-sfc",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s --commit-path .",
"dev": "yarn run build -- --watch",
"lint": "eslint --fix --ext .js,.ts src/**",
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export default (options: PluginOptions = {}): Plugin => {
const requireCompiler = () => {
if (!compiler) {
try {
compiler = require(resolve('node_modules/@vue/compiler-sfc'))
compiler = require('@vue/compiler-sfc')
} catch (e) {
throw new Error('@vue/compiler-sfc is not present in the dependency tree.\n')
}
Expand Down

0 comments on commit fd9b5c1

Please sign in to comment.