added copyright gulp task

This commit is contained in:
Dragos 2019-07-31 15:13:38 +03:00
parent 9240e6a94a
commit b917e07373
2 changed files with 10 additions and 8 deletions

View File

@ -8,7 +8,7 @@ const
year = "2019", year = "2019",
github_MIT_link = "https://github.com/creativetimofficial/vue-material-kit/blob/master/LICENSE.md", github_MIT_link = "https://github.com/creativetimofficial/vue-material-kit/blob/master/LICENSE.md",
product_link = "https://www.creative-tim.com/product/vue-material-kit", product_link = "https://www.creative-tim.com/product/vue-material-kit",
product_free_copyright_template = `/*! product_copyright_template = `/*!
========================================================= =========================================================
* `+ product_name +` - v`+ product_version +` * `+ product_name +` - v`+ product_version +`
@ -27,19 +27,19 @@ const
*/` */`
gulp.task("licenses", async function() { gulp.task("licenses", async function() {
// this is to add Creative Tim licenses in the production mode for the minified js // this is to add Creative Tim licenses in the production & dev mode for the minified js
gulp.src(["dist/js/chunk-vendors*.js", "dist/js/app*.js"], { base: "./" }) gulp.src(["dist/js/chunk-vendors*.js", "dist/js/app*.js"], { base: "./" })
.pipe(gap.prependText(product_free_copyright_template)) .pipe(gap.prependText(product_copyright_template))
.pipe(gulp.dest("./", { overwrite: true })); .pipe(gulp.dest("./", { overwrite: true }));
// this is to add Creative Tim licenses in the production mode for the minified html // this is to add Creative Tim licenses in the production & dev mode for the minified html
gulp.src("dist/index.html", { base: "./" }) gulp.src("dist/index.html", { base: "./" })
.pipe(gap.prependText(product_free_copyright_template)) .pipe(gap.prependText(product_copyright_template))
.pipe(gulp.dest("./", { overwrite: true })); .pipe(gulp.dest("./", { overwrite: true }));
// this is to add Creative Tim licenses in the production mode for the minified css // this is to add Creative Tim licenses in the production & dev mode for the minified css
gulp.src(["dist/css/chunk-vendors*.css", "dist/app*.css"], { base: "./" }) gulp.src(["dist/css/chunk-vendors*.css", "dist/app*.css"], { base: "./" })
.pipe(gap.prependText(product_free_copyright_template)) .pipe(gap.prependText(product_copyright_template))
.pipe(gulp.dest("./", { overwrite: true })); .pipe(gulp.dest("./", { overwrite: true }));
return; return;
}); });

View File

@ -6,7 +6,7 @@
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "vue-cli-service serve --open", "serve": "vue-cli-service serve --open",
"build": "vue-cli-service build", "build": "vue-cli-service build && gulp licenses",
"lint": "vue-cli-service lint", "lint": "vue-cli-service lint",
"dev": "npm run serve", "dev": "npm run serve",
"install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm run dev" "install:clean": "rm -rf node_modules/ && rm -rf package-lock.json && npm install && npm run dev"
@ -26,6 +26,8 @@
"@vue/cli-plugin-eslint": "3.9.2", "@vue/cli-plugin-eslint": "3.9.2",
"@vue/cli-service": "3.9.3", "@vue/cli-service": "3.9.3",
"@vue/eslint-config-prettier": "4.0.1", "@vue/eslint-config-prettier": "4.0.1",
"gulp": "4.0.2",
"gulp-append-prepend": "1.0.8",
"node-sass": "4.12.0", "node-sass": "4.12.0",
"sass-loader": "7.1.0", "sass-loader": "7.1.0",
"vue-template-compiler": "2.6.10" "vue-template-compiler": "2.6.10"