Skip to content

Commit

Permalink
Additional adjustments to asset pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
joshwlewis committed Aug 21, 2024
1 parent 3ff1cba commit 8756851
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions config/webpack/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
const path = require("path")
const webpack = require("webpack")
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const mode = process.env.NODE_ENV === 'development' ? 'development' : 'production';

module.exports = {
mode: "production",
devtool: "source-map",
mode,
entry: {
application: [
"./app/javascript/application.js",
'./app/assets/stylesheets/application.css',
],
},
optimization: {
moduleIds: 'deterministic',
},
output: {
filename: "[name].js",
chunkFilename: "[name]-[contenthash].digested.js",
Expand All @@ -31,8 +34,11 @@ module.exports = {
use: [MiniCssExtractPlugin.loader, 'css-loader', 'sass-loader'],
},
{
test: /\.(png|jpe?g|gif|eot|woff2|woff|ttf|svg)$/i,
use: 'file-loader',
test: /\.(png|jpe?g|svg)$/i,
loader: 'file-loader',
options: {
name: '[name].[ext]',
},
},
],
},
Expand Down

0 comments on commit 8756851

Please sign in to comment.