2024-09-28 20:58:25 -05:00
|
|
|
// See the shakacode/shakapacker README and docs directory for advice on customizing your webpackConfig.
|
|
|
|
const { generateWebpackConfig, merge, mergeWithRules } = require('shakapacker')
|
|
|
|
const cssConfig = require('./rules/css')
|
|
|
|
const svgConfig = require('./rules/svg')
|
|
|
|
const vueConfig = require('./rules/vue')
|
|
|
|
|
|
|
|
const webpackConfig = generateWebpackConfig()
|
2022-12-01 20:13:53 -06:00
|
|
|
|
|
|
|
let conf = merge(vueConfig, svgConfig);
|
|
|
|
conf = merge(cssConfig, conf);
|
|
|
|
conf = merge(conf, webpackConfig);
|
|
|
|
|
|
|
|
const updateFileLoaderConf = {
|
2024-09-28 20:58:25 -05:00
|
|
|
module: {
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
type: 'asset/resource',
|
|
|
|
// This version does not include svg. See https://github.com/shakacode/shakapacker/blob/v6.2.0/package/rules/file.js
|
|
|
|
test: /\.(bmp|gif|jpe?g|png|tiff|ico|avif|webp|eot|otf|ttf|woff|woff2)$/
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
2022-12-01 20:13:53 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
conf = mergeWithRules({
|
2024-09-28 20:58:25 -05:00
|
|
|
module: {
|
|
|
|
rules: {
|
|
|
|
type: "match",
|
|
|
|
test: "replace"
|
2022-12-01 20:13:53 -06:00
|
|
|
}
|
2024-09-28 20:58:25 -05:00
|
|
|
}
|
2022-12-01 20:13:53 -06:00
|
|
|
})(conf, updateFileLoaderConf);
|
|
|
|
|
|
|
|
module.exports = conf
|