Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid dist directory cluttering when running unit tests #398

Merged
merged 1 commit into from
Jun 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,25 @@ module.exports = defineConfig({
// which can run under Chrome headless. Avoid warnings due to custom entries
// and customized filenames. Enable correct code coverage of .vue files.
// Disable Vuetify treeshaking.
// Ensure build is sent to a temporary directory and keep only necessary plugins.
if (process.env.NODE_ENV === 'test') {
const PLUGINS_TO_KEEEP = [
'VueLoaderPlugin',
'DefinePlugin',
'CaseSensitivePathsPlugin',
'FriendlyErrorsWebpackPlugin'
]

config.devtool = 'eval'
config.optimization.runtimeChunk = false
config.optimization.splitChunks = false
config.plugins = config.plugins.filter(plugin => plugin.constructor.name !== 'VuetifyLoaderPlugin')
config.plugins = config.plugins.filter(plugin =>
PLUGINS_TO_KEEEP.includes(plugin.constructor.name)
)
delete config.target
delete config.entry
delete config.output.filename
delete config.output.path
}
},

Expand Down
Loading