Move distributed static/ folder to dist/web/

Move the target folder for the built web interface to dist/web/ instead
of static/.  This better follows the norm for npm packages to include
built files in the dist/ folder and also allows putting other built
files into that folder in the future.
This commit is contained in:
Hornwitser committed 2021-02-17 21:21:18 +01:00
1 parent 207a28cb44
commit b7c7e79a86
8 files changed
+10 -15

No files matched your search

+1 -2
View File
@@ -1,2 +1 @@
packages/master/static dist/
plugins/*/static
-4
View File
@@ -46,10 +46,6 @@ static/export
saves saves
/temp/ /temp/
# Web build
/packages/master/static
/plugins/*/static
# IDE # IDE
.idea/ .idea/
.vs/ .vs/
+3 -3
View File
@@ -115,7 +115,7 @@ function serveWeb(route) {
} }
// Set folder to serve static content from (the website) // Set folder to serve static content from (the website)
app.use(express.static(path.join(__dirname, "static"))); app.use(express.static(path.join(__dirname, "dist", "web")));
app.use(express.static("static")); // Used for data export files app.use(express.static("static")); // Used for data export files
const slaveMappingGauge = new libPrometheus.Gauge( const slaveMappingGauge = new libPrometheus.Gauge(
@@ -2025,8 +2025,8 @@ async function startServer(args) {
} }
let pluginPackagePath = require.resolve(path.posix.join(pluginInfo.requirePath, "package.json")); let pluginPackagePath = require.resolve(path.posix.join(pluginInfo.requirePath, "package.json"));
let staticPath = path.join(path.dirname(pluginPackagePath), "static"); let webPath = path.join(path.dirname(pluginPackagePath), "dist", "web");
app.use(`/plugin/${pluginInfo.name}`, express.static(staticPath)); app.use(`/plugin/${pluginInfo.name}`, express.static(webPath));
} }
// Load plugins // Load plugins
+2 -2
View File
@@ -9,11 +9,11 @@ module.exports = (env = {}) => merge(common(env), {
context: __dirname, context: __dirname,
entry: "./web/index.jsx", entry: "./web/index.jsx",
devServer: { devServer: {
contentBase: "./static", contentBase: "./dist/web",
}, },
output: { output: {
filename: "bundle.js", filename: "bundle.js",
path: path.resolve(__dirname, "static"), path: path.resolve(__dirname, "dist", "web"),
}, },
plugins: [ plugins: [
new webpack.container.ModuleFederationPlugin({ new webpack.container.ModuleFederationPlugin({
+1 -1
View File
@@ -10,7 +10,7 @@ module.exports = (env = {}) => merge(common(env), {
entry: "./web/index.jsx", entry: "./web/index.jsx",
output: { output: {
filename: "bundle.js", filename: "bundle.js",
path: path.resolve(__dirname, "static"), path: path.resolve(__dirname, "dist", "web"),
}, },
plugins: [ plugins: [
new webpack.container.ModuleFederationPlugin({ new webpack.container.ModuleFederationPlugin({
+1 -1
View File
@@ -10,7 +10,7 @@ module.exports = (env = {}) => merge(common(env), {
entry: "./web/index.jsx", entry: "./web/index.jsx",
output: { output: {
filename: "bundle.js", filename: "bundle.js",
path: path.resolve(__dirname, "static"), path: path.resolve(__dirname, "dist", "web"),
}, },
plugins: [ plugins: [
new webpack.container.ModuleFederationPlugin({ new webpack.container.ModuleFederationPlugin({
@@ -10,7 +10,7 @@ module.exports = (env = {}) => merge(common(env), {
entry: "./web/index.jsx", entry: "./web/index.jsx",
output: { output: {
filename: "bundle.js", filename: "bundle.js",
path: path.resolve(__dirname, "static"), path: path.resolve(__dirname, "dist", "web"),
}, },
plugins: [ plugins: [
new webpack.container.ModuleFederationPlugin({ new webpack.container.ModuleFederationPlugin({
+1 -1
View File
@@ -10,7 +10,7 @@ module.exports = (env = {}) => merge(common(env), {
entry: "./web/index.jsx", entry: "./web/index.jsx",
output: { output: {
filename: "bundle.js", filename: "bundle.js",
path: path.resolve(__dirname, "static"), path: path.resolve(__dirname, "dist", "web"),
}, },
plugins: [ plugins: [
new webpack.container.ModuleFederationPlugin({ new webpack.container.ModuleFederationPlugin({