Skip to content

Commit

Permalink
fix: require is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
HomyeeKing committed Jan 6, 2025
1 parent 7dbee72 commit 3220c94
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/ice/src/service/webpackServerCompiler/compiler.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import path from 'path';
import { createRequire } from 'module';
import { fileURLToPath } from 'url';
import { esbuild } from '@ice/bundles';
import TerserPlugin from '@ice/bundles/compiled/terser-webpack-plugin/index.js';
import TsconfigPathsPlugin from '@ice/bundles/compiled/tsconfig-paths-webpack-plugin/index.js';
import webpack from 'webpack';
import { logger } from '../../utils/logger.js';

const require = createRequire(import.meta.url);
const _dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url));

export class WebpackServerCompiler {
private config: webpack.Configuration;

Expand Down

0 comments on commit 3220c94

Please sign in to comment.