drop usage of .env file

This commit is contained in:
nklhrstv 2020-01-30 16:58:25 +02:00
parent bec1799bf3
commit 0af2672152
3 changed files with 9 additions and 6 deletions

1
.env
View file

@ -1 +0,0 @@
SENTRY_DSN=https://e47a6d214ae4478b81136c29612003a7@sentry.io/1911455

View file

@ -3,6 +3,8 @@ const ReactDOM = require('react-dom');
const Sentry = require('@sentry/browser');
const App = require('./App');
Sentry.init({ dsn: process.env.SENTRY_DSN });
if (typeof process.env.SENTRY_DSN === 'string') {
Sentry.init({ dsn: process.env.SENTRY_DSN });
}
ReactDOM.render(<App />, document.getElementById('app'));

View file

@ -1,13 +1,12 @@
const path = require('path');
const webpack = require('webpack');
const dotenv = require('dotenv').config();
const HtmlWebPackPlugin = require('html-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
module.exports = (env, argv) => ({
entry: './src/index.js',
output: {
path: path.join(__dirname, 'build')
@ -129,7 +128,10 @@ module.exports = {
]
},
plugins: [
new webpack.EnvironmentPlugin(dotenv.parsed),
new webpack.EnvironmentPlugin({
DEBUG: argv.mode !== 'production',
...env
}),
new webpack.ProgressPlugin(),
new CopyWebpackPlugin([
{ from: 'node_modules/stremio-core-web/static', to: '' },
@ -147,4 +149,4 @@ module.exports = {
cleanAfterEveryBuildPatterns: ['./main.js', './main.css']
})
]
};
});