Docker-Image with ready-to-use Gulp-Tasks.
This Docker container runs by itself with your given config. We have a couple of predefined tasks that you may use.
You need Docker installed and your user having rights to run containers.
To use the container follow these simple steps:
- copy the contents of the
example
directory to your project. - change the
gulpfile.js
to meet your requirements (sass or less, copy included?) - change the
gulp_config.js
to meet your requirements - make the
gulp
-File executable - run
./gulp build:dev
or./gulp watch
- see gulp running for you, without having to worry with nodejs, module dependencies, complex tasks configuration
To use this container in your build-process:
- TODO
https://hub.docker.com/r/ipunktbs/gulp-tasks/
Build by yourself:
docker build -t ipunktbs/gulp-tasks .
Deletes the directory as defined in your gulp_config.json
.
clean: {
path: "public/"
}
Copies files from one directory to another. Can be configured to copy as many individual files or directories as you want.
copy: [
{
src: "src/**/*", //supports glob syntax
base: "src/", //part of your path that will be your base; copy will start from here
dest: "public/"
}
]
Compiles sass and/or scss to css files using gulp-sass.
Also contains an autoprefixer, cssnano (minify), sourcemaps and gzip.
Sourcemaps will only be generated when running gulp build:dev
.
sass: {
src: "src/css/**/*.scss",
dest: "public/css",
gzip: true, //false if you do not want to additionally gzip your resulting css files.
autoprefixer: { //see https://github.com/postcss/autoprefixer#options
browsers: ["last 3 version"]
},
options: { //see https://github.com/sass/node-sass#options
indentedSyntax: false,
includePaths: []
}
}
Compiles less to css files using gulp-less.
Also contains an autoprefixer, cssnano (minify), sourcemaps and gzip.
Sourcemaps will only be generated when running gulp build:dev
.
less: {
src: "src/css/**/*.less",
dest: "public/css",
gzip: true, //false if you do not want to additionally gzip your resulting css files.
autoprefixer: { //see https://github.com/postcss/autoprefixer#options
browsers: ["last 3 version"]
},
options: { //see https://github.com/plus3network/gulp-less#options
paths: [],
plugins: []
}
}
Just an autoprefixer, cssnano (minify) and gzip for your css files.
css: {
src: "src/css/**/*.css",
dest: "public/css",
gzip: true,
autoprefixer: { //see https://github.com/postcss/autoprefixer#options
browsers: ["last 3 version"]
}
}
Browserify / Watchify task; can be configured to use transforms (currently only ractify).
Also contains uglify, sourcemap and gzip.
Sourcemaps will only be generated when running gulp build:dev
.
browserify: {
src: "src/js/entry.js",
dest: "public/js/bundle.js",
gzip: true, //false if you do not want to additionally gzip your resulting css files.
transforms: { //add your transforms here
ractify: {
extension: "html" //file extension for ractive components
}
}
}
configured using standard webpack configuration.
webpack: {
//see https://webpack.github.io/docs/
//alternatively you can require your webpack-config: require('webpack.config.js');
},
builds your bower dependencies defined in your local bower.json into the defined directory. afterwards copies them into dest.
bower: {
directory: "vendors/.bower", //your bower install directory
dest: "public/vendors" //your public/lib directory (optional)
}