Commit 51a4a743 authored by Nikolay Gromov's avatar Nikolay Gromov

Работет разрешение зависимостей

parent e3bc8f36
...@@ -414,6 +414,27 @@ gulp.task('js', function (callback) { ...@@ -414,6 +414,27 @@ gulp.task('js', function (callback) {
} }
}); });
gulp.task('bf', function () {
var browserify = require('browserify');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var uglify = require('gulp-uglify');
var sourcemaps = require('gulp-sourcemaps');
var log = require('gulplog');
var b = browserify({
entries: dirs.srcPath + '/js/global-script.js',
debug: true
});
return b.bundle()
.pipe(source('script.min.js'))
.pipe(buffer())
.pipe(sourcemaps.init({loadMaps: true}))
// .pipe(uglify())
.on('error', function(){ console.log('error'); })
.pipe(sourcemaps.write('./'))
.pipe(gulp.dest(dirs.buildPath + '/js'));
});
// Ручная оптимизация изображений // Ручная оптимизация изображений
// Использование: folder=src/img npm start img:opt // Использование: folder=src/img npm start img:opt
const folder = process.env.folder; const folder = process.env.folder;
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
"@htmlacademy/editorconfig-cli": "^1.0.0", "@htmlacademy/editorconfig-cli": "^1.0.0",
"autoprefixer": "^9.3.1", "autoprefixer": "^9.3.1",
"browser-sync": "^2.18.8", "browser-sync": "^2.18.8",
"browserify": "^16.2.3",
"chalk": "^2.4.1", "chalk": "^2.4.1",
"const": "^1.0.0", "const": "^1.0.0",
"cross-env": "^5.0.0", "cross-env": "^5.0.0",
...@@ -74,7 +75,8 @@ ...@@ -74,7 +75,8 @@
"postcss-object-fit-images": "^1.1.2", "postcss-object-fit-images": "^1.1.2",
"stylelint": "^9.1.1", "stylelint": "^9.1.1",
"through2": "^3.0.0", "through2": "^3.0.0",
"vinyl-buffer": "^1.0.0" "vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0"
}, },
"dependencies": { "dependencies": {
"baron": "^3.0.3", "baron": "^3.0.3",
......
...@@ -20,3 +20,9 @@ ...@@ -20,3 +20,9 @@
// ready(function(){ // ready(function(){
// // code // // code
// }); // });
let foo = 0;
console.log(foo);
require('./script-a.js');
require('./script-b.js');
require('./script-dep.js');
console.log('this is script A');
require('./script-dep.js');
console.log('this is script B');
console.log('this is script DEPENDENCY');
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment