diff --git a/.babelrc b/.babelrc --- a/.babelrc +++ b/.babelrc @@ -1,4 +1,4 @@ { - "presets": ["es2015"], + "presets": [ "@babel/preset-env" ], "compact": false } diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,5 @@ +# Browsers that we support +last 2 versions +ie >= 9 +ios >= 7 +android >= 4.4 diff --git a/gulpfile.babel.js b/gulpfile.babel.js --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -88,7 +88,9 @@ browsers: COMPATIBILITY })) // Comment in the pipe below to run UnCSS in production - //.pipe($.if(PRODUCTION, $.uncss(UNCSS_OPTIONS))) + // .pipe($.if(PRODUCTION, $.postcss([ + // $.uncss.postcssPlugin(UNCSS_OPTIONS) + // ]))) .pipe($.if(PRODUCTION, $.cleanCss({ compatibility: 'ie9' }))) .pipe($.if(!PRODUCTION, $.sourcemaps.write())) .pipe(gulp.dest(PATHS.dist + '/assets/css')) @@ -96,19 +98,23 @@ } let webpackConfig = { + mode: (PRODUCTION ? 'production' : 'development'), module: { rules: [ { - test: /.js$/, - use: [ - { - loader: 'babel-loader' + test: /\.js$/, + use: { + loader: 'babel-loader', + options: { + presets: ["@babel/preset-env"], + compact: false } - ] + } } ] } } + // Combine JavaScript into one file // In production, the file is minified function javascript() { diff --git a/package.json b/package.json --- a/package.json +++ b/package.json @@ -16,14 +16,14 @@ "motion-ui": "~2.0.3" }, "devDependencies": { - "babel-core": "^6.24.1", - "babel-loader": "^6.4.1", - "babel-preset-es2015": "^6.3.13", - "babel-register": "^6.7.2", + "@babel/core": "^7.1.2", + "@babel/preset-env": "^7.1.0", + "@babel/register": "^7.0.0", + "babel-loader": "^8.0.4", "browser-sync": "^2.10.0", "gulp": "github:gulpjs/gulp#4.0", "gulp-autoprefixer": "^6.0.0", - "gulp-babel": "^6.1.2", + "gulp-babel": "^8.0.0", "gulp-clean-css": "^3.3.1", "gulp-cli": "^2.0.1", "gulp-concat": "^2.5.2", @@ -33,15 +33,15 @@ "gulp-load-plugins": "^1.1.0", "gulp-sass": "^4.0.1", "gulp-sourcemaps": "^1.6.0", - "gulp-uglify": "^1.2.0", - "gulp-uncss": "^1.0.1", + "gulp-uglify": "^3.0.1", + "gulp-postcss": "^8.0.0", "js-yaml": "^3.4.6", "panini": "^1.3.0", "rimraf": "^2.4.3", "style-sherpa": "^1.0.0", "vinyl-named": "^1.1.0", - "webpack": "^2.6.1", - "webpack-stream": "^3.2.0", + "webpack": "^4.20.2", + "webpack-stream": "^5.1.1", "yargs": "^3.8.0" }, "repository": { @@ -52,10 +52,5 @@ "url": "https://github.com/zurb/foundation-sites/issues", "email": "foundation@zurb.com" }, - "babel": { - "presets": [ - "es2015" - ] - }, "private": true }