Skip to content

Commit 96e4957

Browse files
committed
plugged browserslist into babel-env
1 parent c5996e8 commit 96e4957

File tree

4 files changed

+28
-4
lines changed

4 files changed

+28
-4
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ firebase serve
2929
```
3030

3131
- That will build it all and watch the css, img, and js assets.
32-
- Then you can load up `http://localhost:5000` in a browser. narf!
32+
- Then you can load up `http://localhost:5000` or `public/index.html` in a browser. narf!
3333
`/src/index.js` is the main file you'll want to edit for functionality.
3434
- If you have the [LiveReload Chrome extension](https://chrome.google.com/webstore/detail/livereload/jnihajbhpnppcggbcgedagnkighmdlei) installed, it should do live css updates in your browser while gulp watch is running
35+
- CSS is auto-prefixed for the supported browserslist, so don't manually add any browser prefixes to CSS src.
3536
- NOTE: If you change the UI, please update the screenshot at top of this README
3637

3738
## How To Add New Problems
@@ -55,3 +56,6 @@ Each test must have:
5556
This test function will be run on code submission, and MUST return boolean. `output` param is available.
5657
`output` is the output of the JavaScript evaluation of the user's code submission.
5758
This test function may make chai.js assertions or any other comparison against the `output` value.
59+
60+
## Browser support
61+
- See `browserslist` settings in package.json

gulpfile.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// DEPS
2+
// ============================================================
3+
14
const gulp = require('gulp');
25
const sourcemaps = require('gulp-sourcemaps');
36
const browserify = require('browserify');
@@ -13,6 +16,10 @@ const svgo = require('gulp-svgo');
1316
const sass = require('gulp-sass');
1417
const livereload = require('gulp-livereload');
1518

19+
// CONFIG
20+
// ============================================================
21+
const browserslist = require('./package.json').browserslist;
22+
1623
const opts = {
1724
builtins: false,
1825
entries: ['src/js/index.js'],
@@ -24,9 +31,18 @@ const opts = {
2431

2532
const uglifyConf = {};
2633

34+
// TASKS
35+
// ============================================================
36+
2737
function compile(watch) {
2838
const bundler = watchify(browserify(opts).transform(babel.configure({
29-
presets: ['env']
39+
presets: [
40+
['env', {
41+
targets: {
42+
browsers: browserslist
43+
}
44+
}]
45+
]
3046
})));
3147
function rebundle() {
3248
return bundler.bundle()
@@ -62,7 +78,7 @@ function watch() {
6278

6379
gulp.task('css', () => {
6480
const plugins = [
65-
autoprefixer({browsers: ['last 1 version']}),
81+
autoprefixer({browsers: browserslist}),
6682
cssnano()
6783
];
6884
return gulp.src('./src/css/style.scss')

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
"precommit": "yarn test",
1414
"prepush": "yarn test"
1515
},
16+
"browserslist": [
17+
"> 1%",
18+
"last 1 versions"
19+
],
1620
"xo": {
1721
"env": [
1822
"node",

public/dist/css/style.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)