Niedzielski has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/391750 )
Change subject: Chore: move Webpack client config to subdirectory
......................................................................
Chore: move Webpack client config to subdirectory
Move the client Webpack configuration to the client subdirectory in
anticipation of a server-specific configuration.
Bug: T177235
Change-Id: I4ce9bafe11a5480c081cc8b8de6f8da216ae5575
---
M package.json
R src/client/webpack.config.ts
M src/server/index.tsx
3 files changed, 7 insertions(+), 9 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/50/391750/1
diff --git a/package.json b/package.json
index 1ecda26..06a7063 100644
--- a/package.json
+++ b/package.json
@@ -17,9 +17,9 @@
"precommit": "npm test -s",
"--- INTERNAL ---": "# Private scripts.",
"start:server": "nodemon -i dist -i src/client -e js,json,ts,tsx
${VERBOSE:--q} -x 'ts-node -P src/server src/server'",
- "start:client": "webpack-dev-server -dw",
+ "start:client": "webpack-dev-server --config src/client/webpack.config.ts
-dw",
"build:server": "tsc -p src/server && copyup 'src/**/*.{css,svg}' dist/",
- "build:client": "webpack"
+ "build:client": "webpack --config src/client/webpack.config.ts"
},
"repository": {
"type": "git",
diff --git a/webpack.config.ts b/src/client/webpack.config.ts
similarity index 98%
rename from webpack.config.ts
rename to src/client/webpack.config.ts
index ab4ec7e..d0994e3 100644
--- a/webpack.config.ts
+++ b/src/client/webpack.config.ts
@@ -8,16 +8,14 @@
VERBOSE,
WEBPACK_DEV_SERVER_PORT,
WEBPACK_DEV_SERVER_URL
-} from "./src/server/config";
+} from "../server/config";
const UglifyJSPlugin = require("uglifyjs-webpack-plugin");
-const pkg = require("./package.json");
+const pkg = require("../../package.json");
const PATHS = {
// Files used by the client and the server.
- public: {
- output: path.resolve("./dist/public/")
- }
+ public: { output: path.resolve("dist/public") }
};
// `chunkhash` is used instead of `hash` to get per-file / chunk hashes instead
@@ -48,7 +46,7 @@
// `src/client/index` has no correspondence to which page a browser visits.
// e.g., `/`, `/wiki/Foobar`, and `/about` all use the client so that
// subsequent pages can be loaded dynamically inline.
- index: "./src/client"
+ index: __dirname
// (runtime): reserved for the Webpack runtime chunk.
// DO NOT DEFINE AN entry NAMED "runtime"
diff --git a/src/server/index.tsx b/src/server/index.tsx
index 9352630..9e05624 100644
--- a/src/server/index.tsx
+++ b/src/server/index.tsx
@@ -30,7 +30,7 @@
// The asset manifest built or the webpack-dev-server URL (which has no
// manifest).
const manifest = PRODUCTION
- ? require("../../dist/public/assets-manifest.json")
+ ? require("../public/assets-manifest.json")
: WEBPACK_DEV_SERVER_URL;
const server = express();
--
To view, visit https://gerrit.wikimedia.org/r/391750
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4ce9bafe11a5480c081cc8b8de6f8da216ae5575
Gerrit-PatchSet: 1
Gerrit-Project: marvin
Gerrit-Branch: master
Gerrit-Owner: Niedzielski <[email protected]>
Gerrit-Reviewer: Sniedzielski <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits