mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
fix plugin frontend build
This commit is contained in:
@@ -4,9 +4,7 @@ const fs = require("fs");
|
||||
const root = process.cwd();
|
||||
|
||||
const packageJsonPath = path.join(root, "package.json");
|
||||
const packageJSON = JSON.parse(
|
||||
fs.readFileSync(packageJsonPath, { encoding: "UTF-8" })
|
||||
);
|
||||
const packageJSON = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: "UTF-8" }));
|
||||
|
||||
let name = packageJSON.name;
|
||||
const orgaIndex = name.indexOf("/");
|
||||
@@ -18,7 +16,7 @@ module.exports = function(mode) {
|
||||
return {
|
||||
context: root,
|
||||
entry: {
|
||||
[name]: "./src/main/js/index.js"
|
||||
[name]: packageJSON.main || "src/main/js/index.js"
|
||||
},
|
||||
mode,
|
||||
devtool: "source-map",
|
||||
@@ -45,7 +43,7 @@ module.exports = function(mode) {
|
||||
module: {
|
||||
rules: [
|
||||
{
|
||||
test: /\.(js|jsx)$/,
|
||||
test: /\.(js|ts|jsx|tsx)$/i,
|
||||
exclude: /node_modules/,
|
||||
use: {
|
||||
loader: "babel-loader",
|
||||
@@ -64,14 +62,11 @@ module.exports = function(mode) {
|
||||
}
|
||||
]
|
||||
},
|
||||
resolve: {
|
||||
extensions: [".ts", ".tsx", ".js", ".jsx", ".css", ".scss", ".json"]
|
||||
},
|
||||
output: {
|
||||
path: path.join(
|
||||
root,
|
||||
"target",
|
||||
name + "-" + packageJSON.version,
|
||||
"webapp",
|
||||
"assets"
|
||||
),
|
||||
path: path.join(root, "target", name + "-" + packageJSON.version, "webapp", "assets"),
|
||||
filename: "[name].bundle.js",
|
||||
library: name,
|
||||
libraryTarget: "amd"
|
||||
|
||||
Reference in New Issue
Block a user