Browse Source

Fix windows paths in Gulp scripts.

pull/4/head
Roman Axelrod 3 years ago
parent
commit
37ecce6290
  1. 13
      server.js

13
server.js

@ -33,7 +33,6 @@ const {isDev, modulesPath, projectPath, developmentBlockName} = getConfigs();
const blocksRegistry = isDev ? 'http://localhost:3020' : PRODUCTION_REGISTRY_URL;
/**
* Init server
*/
@ -222,7 +221,7 @@ function startBrowserSync() {
return cb();
}]));
gulp.watch(path.join(projectPath, 'src/**/*.scss'), {delay: 400}, gulp.series(['build-styling-files', function (cb) {
gulp.watch(getPathFiles(projectPath, "src/**/*.scss"), {delay: 400}, gulp.series(['build-styling-files', function (cb) {
browserSyncReload(bs, 'css', 'Style Files Change');
return cb();
}]));
@ -276,7 +275,7 @@ function browserSyncReload(bs, extension = '', message = '') {
}
function getJSBundleFiles() {
return [path.join(projectPath, 'src/**/*.js'), path.join(projectPath, 'src/**/*.mjs'), '!' + path.join(projectPath, 'src/**/*.min.js')];
return [getPathFiles(projectPath, "src/**/*.js"), getPathFiles(projectPath, "src/**/*.mjs"), "!" + getPathFiles(projectPath, "src/**/*.min.js")];
}
function buildScriptFiles(done) {
@ -292,7 +291,7 @@ function buildScriptFiles(done) {
.pipe(uglify())
.pipe(rename({extname: '.min.js'}))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(path.join(projectPath, 'src/')));
.pipe(gulp.dest(getPathFiles(projectPath, 'src')));
}
function buildStyleFiles(done) {
@ -306,7 +305,7 @@ function buildStyleFiles(done) {
// .pipe(gulp.dest('src/'))
.pipe(rename({extname: '.min.css'}))
.pipe(sourcemaps.write('.', {}))
.pipe(gulp.dest(path.join(projectPath, 'src')))
.pipe(gulp.dest(getPathFiles(projectPath, 'src')))
}
function buildAssetFiles() {
@ -413,3 +412,7 @@ console.log('Configs', {
developmentBlockName
});
console.log('\n----------------------------------\n')
function getPathFiles(...paths) {
return path.join(...paths).replace(/\\\\/g, '/');
}

Loading…
Cancel
Save