Skip to content

Commit e717b66

Browse files
Configure Browserslist environments
1 parent 1e53c6d commit e717b66

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

.browserslistrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
[javascripts]
2+
supports es6-module
3+
4+
[stylesheets]
15
> 0.1% in GB and not dead
26
last 6 Chrome versions
37
last 6 Firefox versions

babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module.exports = {
2+
browserslistEnv: 'javascripts',
23
presets: [
34
[
45
'@babel/preset-env',

shared/tasks/scripts.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export function webpackJS(done) {
4949
colors: true,
5050
errors: false
5151
},
52-
target: 'browserslist'
52+
target: 'browserslist:javascripts'
5353
}).on('error', (error) => {
5454
done(
5555
new PluginError('webpackJS', error, {

shared/tasks/styles.mjs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,13 @@ export function compileCSS(done) {
5353
}
5454
})
5555
)
56-
.pipe(postcss([autoprefixer()]))
56+
.pipe(
57+
postcss([
58+
autoprefixer({
59+
env: 'stylesheets'
60+
})
61+
])
62+
)
5763
.pipe(
5864
gulp.dest('dist/', {
5965
sourcemaps: '.'
@@ -70,7 +76,13 @@ export function minifyCSS() {
7076
.src('dist/nhsuk.css', {
7177
sourcemaps: true
7278
})
73-
.pipe(postcss([cssnano()]))
79+
.pipe(
80+
postcss([
81+
cssnano({
82+
env: 'stylesheets'
83+
})
84+
])
85+
)
7486

7587
// Output minified
7688
.pipe(

0 commit comments

Comments
 (0)