From 3764d670ffd618396e314033787a3f1f6b53010f Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Fri, 21 Jul 2023 20:57:33 +0200 Subject: [PATCH] Updated gulpfile to ESM and added babelrc --- .babelrc | 12 ++++++++++++ gulpfile.js | 6 +++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .babelrc diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..522c7e1 --- /dev/null +++ b/.babelrc @@ -0,0 +1,12 @@ +{ + "presets": [ + [ + "@babel/preset-env", + { + "targets": { + "node": "current" + } + } + ] + ] +} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 7932ad3..ccb692e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -19,8 +19,8 @@ import sourcemaps from "gulp-sourcemaps"; import terser from "gulp-terser"; // Include paths file. -const paths = require("./_assets/gulp_config/paths"); -sass.compiler = require("node-sass"); +import paths from "./_assets/gulp_config/paths"; +import {render} from "node-sass"; const browserSync = create("gulpfile"); @@ -29,7 +29,7 @@ const browserSync = create("gulpfile"); gulp.task("build:styles:main", function () { return gulp.src(paths.sassFiles + "/main.scss") .pipe(sourcemaps.init()) - .pipe(sass({ + .pipe(sass(render)({ outputStyle: "compressed", includePaths: [paths.includeSass, paths.sassFiles] }).on("error", sass.logError))