Skip to content

Commit

Permalink
feat: Merge pull request #501 from ahabhgk/compat-rspack
Browse files Browse the repository at this point in the history
feat: compatible with rspack
  • Loading branch information
mrsteele authored Mar 20, 2024
2 parents 97a864d + 1140d82 commit c6ebc71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import dotenv from 'dotenv-defaults'
import fs from 'fs'
import { DefinePlugin } from 'webpack'

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

new DefinePlugin(data).apply(compiler)
}
Expand Down

0 comments on commit c6ebc71

Please sign in to comment.