renamed webpack project

This commit is contained in:
andres alcocer
2022-02-08 18:23:42 -05:00
parent cbf9001c65
commit 7bff2879f0
2 changed files with 15 additions and 14 deletions

View File

@@ -1,5 +1,5 @@
{
"name": "webpack-basics",
"name": "netflix-clone",
"version": "1.0.0",
"description": "",
"main": "index.js",

View File

@@ -1,20 +1,21 @@
const HtmlWebPackPlugin = require('html-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const dotenv = require('dotenv');
const webpack = require('webpack');
var path = require('path');
const HtmlWebPackPlugin = require('html-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
const dotenv = require('dotenv')
const webpack = require('webpack')
var path = require('path')
module.exports = () => {
// call dotenv and it will return an Object with a parsed key
const env = dotenv.config().parsed;
const env = dotenv.config().parsed
console.log('env------', env)
// reduce env variables to an oject
const envKeys = Object.keys(env).reduce((prev, next) => {
prev[`process.env.${next}`] = JSON.stringify(env[next]);
return prev;
}, {});
prev[`process.env.${next}`] = JSON.stringify(env[next])
return prev
}, {})
return {
entry: './src/index.js',
@@ -97,5 +98,5 @@ module.exports = () => {
}),
new CleanWebpackPlugin(),
],
};
};
}
}