fix: serve public/assets with webpack-dev-server

This commit is contained in:
Baptiste Grob
2020-07-29 12:38:00 +02:00
parent f7601433b8
commit 90458982ce
3 changed files with 11 additions and 5 deletions

View File

@@ -69,11 +69,13 @@ This repo contains the core code used in the web app, as well as the Electron-ba
**Instructions:**
1. Clone the repo
2. `npm install`
3. `cp index.html.sample index.html`
4. `npm start`
1. `bundle install`
1. `npm install`
1. `bundle exec rails assets:precompile`
1. `cp index.html.sample index.html`
1. `npm start`
Then open your browser to `http://localhost:3000`.
Then open your browser to `http://localhost:3001`.
---

View File

@@ -10,7 +10,7 @@
"start": "webpack-dev-server --progress --config webpack.dev.js",
"watch": "webpack -w --config webpack.dev.js",
"bundle": "webpack --config webpack.prod.js",
"build": "bundle install && npm install && npm run bundle",
"build": "bundle install && npm ci && bundle exec rails assets:precompile && npm run bundle",
"submodules": "git submodule update --init --force --remote",
"lint": "eslint --fix app/assets/javascripts/**/*.js",
"tsc": "tsc --project app/assets/javascripts/tsconfig.json"

View File

@@ -11,6 +11,10 @@ module.exports = (_env, argv) => {
'/extensions': {
target: `http://localhost:${port}`,
pathRewrite: { '^/extensions': '/public/extensions' }
},
'/assets': {
target: `http://localhost:${port}`,
pathRewrite: { '^/assets': '/public/assets' }
}
},
port,