Skip to content

Commit

Permalink
run the transformer as long as we're non-prod
Browse files Browse the repository at this point in the history
This change means that we will now run the transformer if Parcel was run with a custom environment.

We now also exclude CSS files, since they might have a React dependency but they're not script files.
  • Loading branch information
ahixon-atlassian committed Oct 8, 2024
1 parent 6f68c78 commit a60bd42
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import {Transformer} from '@parcel/plugin';
function shouldExclude(asset, options) {
return (
!asset.isSource ||
!asset.type === 'css' ||
!options.hmrOptions ||
!asset.env.isBrowser() ||
asset.env.isLibrary ||
asset.env.isWorker() ||
asset.env.isWorklet() ||
options.mode !== 'development' ||
options.mode === 'production' ||
!asset
.getDependencies()
.find(
Expand Down

0 comments on commit a60bd42

Please sign in to comment.