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 committed 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
@@ -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.