diff --git a/scm-plugins/scm-git-plugin/package.json b/scm-plugins/scm-git-plugin/package.json index 30583cfc9a..8ca5d633e4 100644 --- a/scm-plugins/scm-git-plugin/package.json +++ b/scm-plugins/scm-git-plugin/package.json @@ -3,7 +3,7 @@ "private": true, "version": "2.0.0-SNAPSHOT", "license": "BSD-3-Clause", - "main": "src/main/js/index.js", + "main": "./src/main/js/index.ts", "scripts": { "build": "ui-scripts plugin", "watch": "ui-scripts plugin-watch", diff --git a/scm-plugins/scm-hg-plugin/package.json b/scm-plugins/scm-hg-plugin/package.json index 5f34bd83b8..8baaa729cb 100644 --- a/scm-plugins/scm-hg-plugin/package.json +++ b/scm-plugins/scm-hg-plugin/package.json @@ -3,7 +3,7 @@ "private": true, "version": "2.0.0-SNAPSHOT", "license": "BSD-3-Clause", - "main": "src/main/js/index.js", + "main": "./src/main/js/index.ts", "scripts": { "build": "ui-scripts plugin", "watch": "ui-scripts plugin-watch", diff --git a/scm-plugins/scm-legacy-plugin/package.json b/scm-plugins/scm-legacy-plugin/package.json index 3c6d119b09..2e8ed49862 100644 --- a/scm-plugins/scm-legacy-plugin/package.json +++ b/scm-plugins/scm-legacy-plugin/package.json @@ -3,7 +3,7 @@ "private": true, "version": "2.0.0-SNAPSHOT", "license": "BSD-3-Clause", - "main": "src/main/js/index.js", + "main": "./src/main/js/index.tsx", "scripts": { "build": "ui-scripts plugin", "watch": "ui-scripts plugin-watch", diff --git a/scm-plugins/scm-svn-plugin/package.json b/scm-plugins/scm-svn-plugin/package.json index 9f9028c1b5..c7b0c125b3 100644 --- a/scm-plugins/scm-svn-plugin/package.json +++ b/scm-plugins/scm-svn-plugin/package.json @@ -3,7 +3,7 @@ "private": true, "version": "2.0.0-SNAPSHOT", "license": "BSD-3-Clause", - "main": "src/main/js/index.js", + "main": "./src/main/js/index.ts", "scripts": { "build": "ui-scripts plugin", "watch": "ui-scripts plugin-watch", diff --git a/scm-ui/ui-scripts/src/createPluginConfig.js b/scm-ui/ui-scripts/src/createPluginConfig.js index e8a45df534..4d64a88d12 100644 --- a/scm-ui/ui-scripts/src/createPluginConfig.js +++ b/scm-ui/ui-scripts/src/createPluginConfig.js @@ -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" diff --git a/scm-ui/ui-scripts/src/webpack.config.js b/scm-ui/ui-scripts/src/webpack.config.js index 3521dd7330..5313ec7a1e 100644 --- a/scm-ui/ui-scripts/src/webpack.config.js +++ b/scm-ui/ui-scripts/src/webpack.config.js @@ -8,11 +8,7 @@ module.exports = [ { context: root, entry: { - webapp: [ - "./ui-webapp/src/webpack-public-path.ts", - "./ui-styles/src/scm.scss", - "./ui-webapp/src/index.tsx" - ] + webapp: ["./ui-webapp/src/webpack-public-path.ts", "./ui-styles/src/scm.scss", "./ui-webapp/src/index.tsx"] }, devtool: "cheap-module-eval-source-map", target: "web", @@ -66,9 +62,7 @@ module.exports = [ ] }, resolve: { - extensions: [ - ".ts", ".tsx", ".js", ".jsx", ".css", ".scss", ".json" - ] + extensions: [".ts", ".tsx", ".js", ".jsx", ".css", ".scss", ".json"] }, output: { path: path.join(root, "target", "assets"), @@ -84,12 +78,7 @@ module.exports = [ app.use(createContextPathMiddleware("/scm")); }, after: function(app) { - const templatePath = path.join( - root, - "ui-webapp", - "public", - "index.mustache" - ); + const templatePath = path.join(root, "ui-webapp", "public", "index.mustache"); const renderParams = { contextPath: "/scm" };