Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3bbc80 commit 31df978Copy full SHA for 31df978
examples/webpack.config.react.js
@@ -1,7 +1,9 @@
1
const webpack = require('webpack')
2
const HtmlWebpackPlugin = require('html-webpack-plugin')
3
const path = require('path')
4
-const dotenv = require('dotenv').config()
+const fs = require('fs')
5
+
6
+require('dotenv').config()
7
8
module.exports = {
9
mode: "development",
@@ -46,6 +48,14 @@ module.exports = {
46
48
contentBase: path.join(__dirname, 'build')
47
49
},
50
plugins: [
51
+ function () {
52
+ this.plugin('done', function (stats) {
53
+ if (!fs.existsSync('.env')) {
54
+ console.error('\n\nERROR: No .env file found... Did you copy default.env to .env?\n\n');
55
+ process.exit(1);
56
+ }
57
+ });
58
+ },
59
new webpack.DefinePlugin({
60
'EXAMPLE_ENV': {
61
'CHAIN_ID': JSON.stringify(process.env.CHAIN_ID),
0 commit comments