Files
danbooru/config/webpack/base.js
evazion 206a4b5de5 docker: avoid rebuilding CSS/JS assets on every commit.
Restructure the Dockerfile and the CSS/JS files so that we only rebuild
the CSS and JS when they change, not on every commit.

Before it took several minutes to rebuild the Docker image after every
commit, even when the JS/CSS files didn't change. This also made pulling
images slower.

This requires refactoring the CSS and JS to not use embedded Ruby (ERB)
templates, since this made the CSS and JS dependent on the Ruby
codebase, which is why we had to rebuild the assets after every Ruby
change.
2021-10-13 02:48:30 -05:00

24 lines
452 B
JavaScript

const { webpackConfig, merge } = require('@rails/webpacker')
module.exports = merge(webpackConfig, {
// output: {
// library: "Danbooru",
// },
resolve: {
alias: {
"jquery": "jquery/src/jquery.js",
"react": "preact/compat",
"react-dom": "preact/compat",
}
},
module: {
rules: [{
test: /\.wasm$/,
type: 'asset/resource',
generator: {
filename: 'js/[name][ext]'
}
}]
},
});