Skip to content

Commit

Permalink
Properly include env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyZhang777 committed Jan 26, 2024
1 parent 03b7d6f commit fa67f00
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test-site/webpack.config.js
@@ -1,4 +1,5 @@
const path = require('path');
const webpack = require('webpack');

module.exports = [{
mode: 'development',
Expand All @@ -20,6 +21,11 @@ module.exports = [{
path: path.resolve(__dirname, 'dist'),
libraryTarget: 'window'
},
plugins: [
new webpack.DefinePlugin({
'process.env.API_KEY': JSON.stringify(process.env.API_KEY),
})
],
}, {
mode: 'development',
entry: './src/js/index.js',
Expand All @@ -32,4 +38,9 @@ module.exports = [{
libraryTarget: 'window'
},
target: ['web', 'es5'],
plugins: [
new webpack.DefinePlugin({
'process.env.API_KEY': JSON.stringify(process.env.API_KEY),
})
],
}];

0 comments on commit fa67f00

Please sign in to comment.