Skip to content

Commit 3d2d447

Browse files
committed
refactor: remove unused file system operations in Vite plugin
1 parent 5487b9a commit 3d2d447

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

vite.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
const { parse } = require('acorn')
22
const OptionsParser = require('./lib/options-parser')
33
const { detectReactComponents, generateDisplayNameCode } = require('./lib/component-detector')
4-
const fs = require('node:fs')
5-
const path = require('node:path')
64

75
const VALID_FILE_SUFFIXES_REGEX = /\.(js|jsx|ts|tsx)$/
86

@@ -21,10 +19,6 @@ function ViteReactComponentNamePlugin(options) {
2119
enforce: 'post',
2220

2321
transform(code, id) {
24-
fs.mkdirSync('built', { recursive: true })
25-
try {
26-
fs.writeFileSync(`built/${path.basename(id)}`, code)
27-
} catch (e) {}
2822
// Ignore non-JS files
2923
if (!VALID_FILE_SUFFIXES_REGEX.test(id.toLowerCase())) {
3024
return null

0 commit comments

Comments
 (0)