Skip to content

Commit

Permalink
build: set up Browserslist environments
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Feb 26, 2025
1 parent b4b5550 commit b4e1ea4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[javascripts]
supports es6-module

[stylesheets]
> 0.1% in GB and not dead
last 6 Chrome versions
last 6 Firefox versions
Expand Down
1 change: 1 addition & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
browserslistEnv: 'javascripts',
presets: [
[
'@babel/preset-env',
Expand Down
6 changes: 5 additions & 1 deletion gulp/tasks/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ function compileStyles(assetPath, { srcPath, destPath, output = {} }) {
}

// Apply PostCSS transforms (e.g. vendor prefixes)
const processor = postcss([autoprefixer(), cssnano()])
const processor = postcss([
autoprefixer({ env: 'stylesheets' }),
cssnano({ env: 'stylesheets' })
])

const result = await processor.process(css, {
from,
to,
Expand Down

0 comments on commit b4e1ea4

Please sign in to comment.