Skip to content

Commit 9104886

Browse files
feat: configure Babel for browsers with ES module support
1 parent 50be839 commit 9104886

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

.browserslistrc

+4
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

+1
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',

gulp/tasks/styles.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ function compileStyles(assetPath, { srcPath, destPath, output = {} }) {
3636
}
3737

3838
// Apply PostCSS transforms (e.g. vendor prefixes)
39-
const processor = postcss([autoprefixer(), cssnano()])
39+
const processor = postcss([
40+
autoprefixer({ env: 'stylesheets' }),
41+
cssnano({ env: 'stylesheets' })
42+
])
43+
4044
const result = await processor.process(css, {
4145
from,
4246
to,

0 commit comments

Comments
 (0)