All checks were successful
gitea-deepak/gog_frontend/pipeline/head This commit looks good
73 lines
1.4 KiB
JavaScript
73 lines
1.4 KiB
JavaScript
const path = require("path");
|
|
const webpack = require("webpack");
|
|
|
|
module.exports = {
|
|
entry: "./src/index.jsx",
|
|
mode: "development",
|
|
module: {
|
|
rules: [
|
|
{
|
|
test: /\.(js|jsx)$/,
|
|
exclude: /(node_modules|bower_components)/,
|
|
loader: "babel-loader",
|
|
options: { presets: ["@babel/env"] },
|
|
},
|
|
{
|
|
test: /\.css$/,
|
|
use: ["style-loader", "css-loader"],
|
|
},
|
|
{
|
|
test: /\.s[ac]ss$/i,
|
|
use: [
|
|
"style-loader",
|
|
"css-loader",
|
|
"resolve-url-loader",
|
|
{
|
|
loader: "sass-loader",
|
|
options: {
|
|
implementation: require("sass"),
|
|
sourceMap: true,
|
|
},
|
|
},
|
|
]
|
|
},
|
|
{
|
|
test: /\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
|
|
use: [
|
|
{
|
|
loader: 'file-loader',
|
|
options: {
|
|
name: '[name].[ext]',
|
|
outputPath: 'fonts/'
|
|
},
|
|
},
|
|
]
|
|
},
|
|
],
|
|
},
|
|
resolve: { extensions: ["*", ".js", ".jsx"] },
|
|
output: {
|
|
path: path.resolve(__dirname, "dist/"),
|
|
publicPath: "/dist/",
|
|
filename: "bundle.js",
|
|
},
|
|
devServer: {
|
|
contentBase: path.join(__dirname, "public/"),
|
|
port: 3000,
|
|
publicPath: "http://localhost:3000/dist/",
|
|
hotOnly: true,
|
|
proxy: {
|
|
"/api": {
|
|
target: "http://localhost:8080",
|
|
pathRewrite: { "^/api": "" },
|
|
},
|
|
},
|
|
},
|
|
plugins: [
|
|
new webpack.HotModuleReplacementPlugin(),
|
|
new webpack.EnvironmentPlugin({
|
|
API_ROOT: "http://localhost:8080/"
|
|
})
|
|
],
|
|
};
|