Fix compiled assets for prod environments

- Set devtool to 'eval-source-map' only in development mode in webpack.config.js
This commit is contained in:
Jonny Barnes 2023-05-27 17:21:46 +01:00
parent 6dc3803f51
commit f5b037265b
Signed by: jonny
SSH key fingerprint: SHA256:CTuSlns5U7qlD9jqHvtnVmfYV3Zwl2Z7WnJ4/dqOaL8
3 changed files with 10 additions and 3 deletions

File diff suppressed because one or more lines are too long

Binary file not shown.

11
webpack.config.js vendored
View file

@ -4,8 +4,7 @@ const CompressionPlugin = require('compression-webpack-plugin');
const zlib = require('zlib'); const zlib = require('zlib');
const EslintPlugin = require('eslint-webpack-plugin'); const EslintPlugin = require('eslint-webpack-plugin');
module.exports = { const config = {
devtool: 'eval-source-map',
entry: ['./resources/js/app.js'], entry: ['./resources/js/app.js'],
output: { output: {
path: path.resolve('./public/assets'), path: path.resolve('./public/assets'),
@ -71,3 +70,11 @@ module.exports = {
}), }),
] ]
}; };
module.exports = (env, argv) => {
if (argv.mode === 'development') {
config.devtool = 'eval-source-map';
}
return config;
};