renamed webpack project
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "webpack-basics",
|
"name": "netflix-clone",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
|||||||
@@ -1,20 +1,21 @@
|
|||||||
const HtmlWebPackPlugin = require('html-webpack-plugin');
|
const HtmlWebPackPlugin = require('html-webpack-plugin')
|
||||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
const CopyWebpackPlugin = require('copy-webpack-plugin')
|
||||||
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
|
||||||
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
|
const { CleanWebpackPlugin } = require('clean-webpack-plugin')
|
||||||
const dotenv = require('dotenv');
|
const dotenv = require('dotenv')
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack')
|
||||||
var path = require('path');
|
var path = require('path')
|
||||||
|
|
||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
// call dotenv and it will return an Object with a parsed key
|
// 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
|
// reduce env variables to an oject
|
||||||
const envKeys = Object.keys(env).reduce((prev, next) => {
|
const envKeys = Object.keys(env).reduce((prev, next) => {
|
||||||
prev[`process.env.${next}`] = JSON.stringify(env[next]);
|
prev[`process.env.${next}`] = JSON.stringify(env[next])
|
||||||
return prev;
|
return prev
|
||||||
}, {});
|
}, {})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
entry: './src/index.js',
|
entry: './src/index.js',
|
||||||
@@ -97,5 +98,5 @@ module.exports = () => {
|
|||||||
}),
|
}),
|
||||||
new CleanWebpackPlugin(),
|
new CleanWebpackPlugin(),
|
||||||
],
|
],
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user