diff --git a/etc/dev-start.sh b/etc/dev-start.sh index 995edde..52366be 100755 --- a/etc/dev-start.sh +++ b/etc/dev-start.sh @@ -6,7 +6,7 @@ export INBUCKET_LOGLEVEL="debug" export INBUCKET_SMTP_DISCARDDOMAINS="bitbucket.local" export INBUCKET_WEB_TEMPLATECACHE="false" export INBUCKET_WEB_COOKIEAUTHKEY="not-secret" -export INBUCKET_WEB_UIDIR="ui/build" +export INBUCKET_WEB_UIDIR="ui/dist" export INBUCKET_STORAGE_TYPE="file" export INBUCKET_STORAGE_PARAMS="path:/tmp/inbucket" export INBUCKET_STORAGE_RETENTIONPERIOD="3h" diff --git a/ui/package.json b/ui/package.json new file mode 100644 index 0000000..8b86b81 --- /dev/null +++ b/ui/package.json @@ -0,0 +1,24 @@ +{ + "name": "inbucket-ui", + "version": "3.0.0", + "license": "MIT", + "private": true, + "scripts": { + "build": "webpack --mode production", + "watch": "webpack --mode development --watch", + "dev": "webpack-dev-server --mode development --port 3000", + "errors": "webpack --mode development --display-error-details" + }, + "dependencies": {}, + "devDependencies": { + "css-loader": "^1.0.1", + "elm-hot-webpack-loader": "^1.0.2", + "elm-webpack-loader": "^5.0.0", + "html-webpack-plugin": "^3.2.0", + "node-elm-compiler": "^5.0.1", + "style-loader": "^0.23.1", + "webpack": "^4.25.1", + "webpack-cli": "^3.1.2", + "webpack-dev-server": "^3.1.10" + } +} diff --git a/ui/public/index.html b/ui/public/index.html index feb4250..4def5dc 100644 --- a/ui/public/index.html +++ b/ui/public/index.html @@ -1,22 +1,16 @@ - - - - - - - - Inbucket + + + + + Inbucket - -
+ +
diff --git a/ui/public/manifest.json b/ui/public/manifest.json index 9b7dc41..e304f40 100644 --- a/ui/public/manifest.json +++ b/ui/public/manifest.json @@ -1,10 +1,10 @@ { - "short_name": "Elm App", - "name": "Create Elm App Sample", + "short_name": "Inbucket", + "name": "Inbucket", "icons": [ { - "src": "favicon.ico", - "sizes": "192x192", + "src": "favicon.png", + "sizes": "16x16", "type": "image/png" } ], diff --git a/ui/src/index.js b/ui/src/index.js index 0291e94..b3249be 100644 --- a/ui/src/index.js +++ b/ui/src/index.js @@ -1,6 +1,5 @@ import './main.css' import { Elm } from './Main.elm' -import registerServiceWorker from './registerServiceWorker' import registerMonitorPorts from './registerMonitor' // App startup. @@ -39,5 +38,3 @@ function sessionObject() { app.ports.windowTitle.subscribe(function (title) { document.title = title }) - -registerServiceWorker() diff --git a/ui/webpack.config.js b/ui/webpack.config.js new file mode 100644 index 0000000..5676d39 --- /dev/null +++ b/ui/webpack.config.js @@ -0,0 +1,49 @@ +const HtmlWebpackPlugin = require('html-webpack-plugin') +const webpack = require('webpack') + +module.exports = { + mode: 'development', + output: { + filename: 'static/[name].js', + publicPath: '/', + }, + module: { + rules: [ + { + test: /\.elm$/, + exclude: [/elm-stuff/, /node_modules/], + use: [ + { loader: 'elm-hot-webpack-loader' }, + { + loader: 'elm-webpack-loader', + options: { + debug: true + }, + }, + ], + }, + { + test: /\.css$/, + exclude: [/node_modules/], + loader: ['style-loader', 'css-loader'], + }, + ] + }, + plugins: [ + new HtmlWebpackPlugin({ + template: 'public/index.html', + favicon: 'public/favicon.png', + }), + new webpack.HotModuleReplacementPlugin(), + ], + devServer: { + inline: true, + hot: true, + stats: { colors: true }, + proxy: [{ + context: ['/api', '/debug', '/serve'], + target: 'http://localhost:9000', + ws: true, + }], + }, +};