From 4ad5eebb06537dad58c390c0a9a30f710d2265bd Mon Sep 17 00:00:00 2001 From: Jonas Enlund Date: Sun, 7 Feb 2016 20:42:30 +0200 Subject: [PATCH] [#26] Set build paths to clojure defaults (wip) --- .../resources/org/akvo/dash/public/index.html | 44 +++++-------------- client/index.html | 12 ----- client/server.js | 3 ++ client/webpack.config.js | 8 ++-- 4 files changed, 18 insertions(+), 49 deletions(-) delete mode 100644 client/index.html diff --git a/backend/resources/org/akvo/dash/public/index.html b/backend/resources/org/akvo/dash/public/index.html index 3275beff44..f159fecf21 100644 --- a/backend/resources/org/akvo/dash/public/index.html +++ b/backend/resources/org/akvo/dash/public/index.html @@ -1,36 +1,12 @@ - - - Welcome to Duct - - - - -

Welcome to Duct

-
-

Congratulations! Your project backend is - ready and running.

-

This is a static welcome page located at resources/backend/index.html - in the project directory. Remove or replace it when you start developing. - If you remove the index page entirely, be sure to change the :aliases - map in backend.system/base-config. -

-
-

Template profiles used:

-
-
+example
-
Adds an example endpoint at /example.
-
+postgres
-
Adds a PostgreSQL dependency and database component. The database used for - development defaults to postgres on localhost.
-
+ragtime
-
Adds Ragtime migrations. Use (migrate) and (rollback) - in the REPL. Migrations are stored in resources/backend/migrations. -
-
+site
-
Adds middleware and configuration suited for a user-facing website.
-
-
- - + + + + Akvo DASH + + + +
+ + diff --git a/client/index.html b/client/index.html deleted file mode 100644 index 6584c85206..0000000000 --- a/client/index.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - Akvo DASH - - - -
- - - diff --git a/client/server.js b/client/server.js index 8a3a5d6d72..050341da04 100644 --- a/client/server.js +++ b/client/server.js @@ -2,7 +2,10 @@ var webpack = require('webpack'); var WebpackDevServer = require('webpack-dev-server'); var config = require('./webpack.config'); +const contentBase = __dirname.substring(0, __dirname.lastIndexOf('/')) + '/backend/resources/org/akvo/dash/public' + new WebpackDevServer(webpack(config), { + contentBase: contentBase, publicPath: config.output.publicPath, hot: true, historyApiFallback: true, diff --git a/client/webpack.config.js b/client/webpack.config.js index b458c7264c..13476f8613 100644 --- a/client/webpack.config.js +++ b/client/webpack.config.js @@ -7,18 +7,20 @@ const entry = process.env.NODE_ENV === 'production' ? [ "./src/index.jsx" ] : [ - 'webpack-dev-server/client?http://0.0.0.0:3000', // WebpackDevServer host and port + 'webpack-dev-server/client?http://0.0.0.0:3030', // WebpackDevServer host and port 'webpack/hot/only-dev-server', // "only" prevents reload on syntax errors "./src/index.jsx" ]; +const path = __dirname.substring(0, __dirname.lastIndexOf('/')) + '/backend/resources/org/akvo/dash/public/build' + module.exports = { entry: entry, devtool: 'source-map', output: { - path: __dirname, + path: path, filename: "bundle.js", - publicPath: '/' + publicPath: 'build' }, resolve: { extensions: ['', '.js', '.jsx']