Skip to content

Commit

Permalink
fix: ionicons not found on webpack dev server
Browse files Browse the repository at this point in the history
  • Loading branch information
johnny243 committed Jul 15, 2020
1 parent 4de62de commit 28708c4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
"scripts": {
"start": "webpack-dev-server --progress",
"bundle": "webpack --mode production",
"build": "bundle install && npm ci && bundle exec rails assets:precompile && npm run bundle",
"precompile:assets": "bundle exec rails assets:precompile",
"postinstall": "npm run precompile:assets",
"build": "bundle install && npm ci && npm run precompile:assets && npm run bundle",
"submodules": "git submodule update --init --force --remote",
"test": "karma start karma.conf.js --single-run",
"lint": "eslint --fix app/assets/javascripts/**/*.js"
Expand Down
10 changes: 8 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const path = require('path');
const webpack = require('webpack');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');

const port = 3000;

module.exports = {
entry: './app/assets/javascripts/index.js',
output: {
Expand All @@ -10,11 +12,15 @@ module.exports = {
devServer: {
proxy: {
'/extensions': {
target: 'http://localhost:3000',
target: `http://localhost:${port}`,
pathRewrite: { '^/extensions': '/public/extensions' }
},
'/assets': {
target: `http://localhost:${port}`,
pathRewrite: { '^/assets': '/public/assets' }
}
},
port: 3000
port
},
plugins: [
new webpack.DefinePlugin({
Expand Down

0 comments on commit 28708c4

Please sign in to comment.