Skip to content

Commit

Permalink
fix: serve public/assets with webpack-dev-server
Browse files Browse the repository at this point in the history
  • Loading branch information
arielsvg committed Jul 29, 2020
1 parent f760143 commit 9045898
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

---

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9045898

Please sign in to comment.