Skip to content

Commit

Permalink
fix: remove all peer dependency, close #170
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Sep 21, 2022
1 parent 19b0233 commit 6d3d5af
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 23 deletions.
20 changes: 0 additions & 20 deletions package.json
Expand Up @@ -60,25 +60,5 @@
"vitest": "^0.23.4",
"webpack": "^5.74.0",
"webpack-cli": "^4.10.0"
},
"peerDependencies": {
"esbuild": ">=0.13",
"rollup": "^2.50.0",
"vite": "^2.3.0 || ^3.0.0-0",
"webpack": "4 || 5"
},
"peerDependenciesMeta": {
"esbuild": {
"optional": true
},
"rollup": {
"optional": true
},
"vite": {
"optional": true
},
"webpack": {
"optional": true
}
}
}
6 changes: 3 additions & 3 deletions src/esbuild/index.ts
@@ -1,4 +1,4 @@
import fs, { existsSync, mkdirSync } from 'fs'
import fs from 'fs'
import path from 'path'
import chokidar from 'chokidar'
import type { PartialMessage } from 'esbuild'
Expand Down Expand Up @@ -52,8 +52,8 @@ export function getEsbuildPlugin <UserOptions = {}> (
}

// Ensure output directory exists for this.emitFile
if (initialOptions.outdir && !existsSync(initialOptions.outdir)) {
mkdirSync(initialOptions.outdir, { recursive: true })
if (initialOptions.outdir && !fs.existsSync(initialOptions.outdir)) {
fs.mkdirSync(initialOptions.outdir, { recursive: true })
}

if (plugin.buildStart) {
Expand Down
6 changes: 6 additions & 0 deletions tsup.config.ts
Expand Up @@ -12,6 +12,12 @@ export const tsup: Options = {
'src/webpack/loaders/load.ts',
'src/webpack/loaders/transform.ts'
],
external: [
'vite',
'webpack',
'rollup',
'esbuild'
],
define: {
__DEV__: 'false'
}
Expand Down

0 comments on commit 6d3d5af

Please sign in to comment.