Skip to content

Commit f87e01b

Browse files
Merge pull request #39 from quantfive/fix/top-level-imports
refactor: Move fs/path to top-level imports in webpack plugin
2 parents 231960a + 1a11419 commit f87e01b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/webpack-plugin.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
import type { Compilation, Compiler, Module as WebpackModule } from "webpack";
2424
import { sources } from "webpack";
25+
import fs from "fs";
26+
import path from "path";
2527

2628
interface Asset {
2729
name: string;
@@ -108,9 +110,6 @@ export default class CodePressWebpackPlugin {
108110

109111
// Always try to read @ alias from tsconfig.json if not already present
110112
// resolve.alias usually has Next.js internals but not the @ path alias
111-
const fs = require("fs");
112-
const path = require("path");
113-
114113
if (!aliases.has("@")) {
115114
const tsconfigPath = path.join(compiler.context, "tsconfig.json");
116115

0 commit comments

Comments
 (0)