Initial commit
This commit is contained in:
+14
-10
@@ -5,11 +5,12 @@ const dotenv = require('dotenv');
|
||||
|
||||
const env = dotenv.config({ path: path.resolve(__dirname, '.env.local') }).parsed || {};
|
||||
|
||||
const API_BASE_URL =
|
||||
env.API_BASE_URL || process.env.API_BASE_URL || 'http://127.0.0.1:3000';
|
||||
const DEFAULT_DEV_API = 'http://127.0.0.1:3000';
|
||||
|
||||
const API_BASE_URL = env.API_BASE_URL || process.env.API_BASE_URL || DEFAULT_DEV_API;
|
||||
|
||||
module.exports = {
|
||||
entry: './src/index.js',
|
||||
entry: './src/index.jsx',
|
||||
output: {
|
||||
filename: 'bundle.[contenthash].js',
|
||||
path: path.resolve(__dirname, 'dist'),
|
||||
@@ -17,6 +18,13 @@ module.exports = {
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.jsx?$/,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: 'babel-loader',
|
||||
},
|
||||
},
|
||||
{
|
||||
test: /\.css$/i,
|
||||
use: ['style-loader', 'css-loader'],
|
||||
@@ -40,13 +48,9 @@ module.exports = {
|
||||
port: 5173,
|
||||
historyApiFallback: true,
|
||||
open: true,
|
||||
proxy: [
|
||||
{
|
||||
context: ['/api'],
|
||||
target: API_BASE_URL,
|
||||
changeOrigin: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
devtool: 'source-map',
|
||||
resolve: {
|
||||
extensions: ['.js', '.jsx'],
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user