Skip to content

Commit c6ebc71

Browse files
authored
feat: Merge pull request #501 from ahabhgk/compat-rspack
feat: compatible with rspack
2 parents 97a864d + 1140d82 commit c6ebc71

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import dotenv from 'dotenv-defaults'
22
import fs from 'fs'
3-
import { DefinePlugin } from 'webpack'
43

54
// Mostly taken from here: https://github.com/motdotla/dotenv-expand/blob/master/lib/main.js#L4
65
const interpolate = (env, vars) => {
@@ -46,6 +45,7 @@ class Dotenv {
4645
target,
4746
version
4847
})
48+
const DefinePlugin = (compiler.webpack && compiler.webpack.DefinePlugin) || require('webpack').DefinePlugin
4949

5050
new DefinePlugin(data).apply(compiler)
5151
}

0 commit comments

Comments
 (0)