Skip to content

Commit

Permalink
webpack でコンパイルしたファイルが読み込めていなかったのを修正
Browse files Browse the repository at this point in the history
以下の修正を含む
* 互換性警告が出ていた webpack.config.js の [hash] を [contenthash] に置換
* 不要になった config/webpacker.yml を削除
  • Loading branch information
koi-chan committed Jan 16, 2024
1 parent 2d0f21a commit 378b0b7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 98 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
run: |
cp config/database.yml.github_actions config/database.yml
bin/rails db:setup
- name: Compile JS (webpack)
run: bin/yarn webpack
- name: Compile JavaScripts (webpack)
run: NODE_ENV=production bin/yarn webpack
- uses: paambaati/codeclimate-action@v2.7.5
env:
CC_TEST_REPORTER_ID: 74e589ede57e23f089cbbd2eee75be23a93b5ace7b5cfce58213cd3f21447147
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
run: |
cp config/database.yml.github_actions config/database.yml
bin/rails db:setup
- name: Compile JS (webpack)
run: bin/yarn webpack
- name: Compile JavaScripts (webpack)
run: NODE_ENV=production bin/yarn webpack
- name: Run tests
run: bin/rails test
92 changes: 0 additions & 92 deletions config/webpacker.yml

This file was deleted.

4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
application: path.resolve(__dirname, "app/javascript/packs/application.js"),
},
output: {
filename: isProd ? "[name]-[hash].js" : "[name].js",
filename: isProd ? "[name]-[contenthash].js" : "[name].js",
path: path.resolve(__dirname, "public/packs"),
publicPath: isProd ? "/packs/" : "//localhost:8080/packs/",
},
Expand All @@ -40,7 +40,7 @@ module.exports = {
plugins: [
new CaseSensitivePathsPlugin(),
new MiniCssExtractPlugin({
filename: isProd ? "[name]-[hash].css" : "[name].css",
filename: isProd ? "[name]-[contenthash].css" : "[name].css",
}),
new WebpackAssetsManifest({
entrypoints: true,
Expand Down

0 comments on commit 378b0b7

Please sign in to comment.