build css script

pull/12/head
cagataycivici 2019-05-25 16:49:00 +03:00
parent fb23ad37ff
commit c3fbdd9d5d
4 changed files with 57 additions and 10 deletions

3
.gitignore vendored
View File

@ -1,6 +1,8 @@
.DS_Store .DS_Store
node_modules node_modules
/dist /dist
/resources
/components
# misc # misc
/.sass-cache /.sass-cache
@ -28,3 +30,4 @@ yarn-error.log*
*.njsproj *.njsproj
*.sln *.sln
*.sw* *.sw*

View File

@ -3,11 +3,6 @@ const path = require('path');
const {execSync} = require('child_process'); const {execSync} = require('child_process');
const vueCliServicePath = path.resolve(__dirname, 'node_modules/@vue/cli-service/bin/vue-cli-service'); const vueCliServicePath = path.resolve(__dirname, 'node_modules/@vue/cli-service/bin/vue-cli-service');
fs.copyFile('source.txt', 'destination.txt', (err) => {
if (err) throw err;
console.log('source.txt was copied to destination.txt');
});
fs.readdirSync(path.resolve(__dirname, './src/components/')).forEach(folder => { fs.readdirSync(path.resolve(__dirname, './src/components/')).forEach(folder => {
fs.readdirSync(path.resolve(__dirname, './src/components/' + folder)).forEach(file => { fs.readdirSync(path.resolve(__dirname, './src/components/' + folder)).forEach(file => {
if (/\.vue$/.test(file)) { if (/\.vue$/.test(file)) {

44
gulpfile.js Normal file
View File

@ -0,0 +1,44 @@
'use strict';
var gulp = require('gulp'),
concat = require('gulp-concat'),
uglifycss = require('gulp-uglifycss'),
rename = require('gulp-rename'),
del = require('del'),
flatten = require('gulp-flatten');
gulp.task('build-css', function() {
return gulp.src([
'src/components/common/Common.css',
'src/components/**/*.css'
])
.pipe(concat('primevue.css'))
.pipe(gulp.dest('resources'))
.pipe(uglifycss({"uglyComments": true}))
.pipe(rename('primevue.min.css'))
.pipe(gulp.dest('resources'));
});
gulp.task('build-themes', function() {
return gulp.src([
'public/themes/**/*'
])
.pipe(uglifycss({"uglyComments": true}))
.pipe(gulp.dest('resources/themes'));
})
gulp.task('images', function() {
return gulp.src(['src/components/**/images/*.png', 'src/components/**/images/*.gif'])
.pipe(flatten())
.pipe(gulp.dest('resources/images'));
});
gulp.task('build-exports', function() {
return gulp.src(['exports/*.js','exports/*.d.ts'])
.pipe(gulp.dest('./'));
});
//Building project with run sequence
gulp.task('build-resources', ['build-css','images', 'build-themes']);

View File

@ -8,8 +8,9 @@
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
"serve": "vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "vue-cli-service build", "build-app": "vue-cli-service build",
"build-lib": "node build-lib", "build-lib": "node build-lib",
"build-resources": "gulp build-resources",
"lint": "vue-cli-service lint", "lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit" "test:unit": "vue-cli-service test:unit"
}, },
@ -37,9 +38,13 @@
"@fullcalendar/daygrid": "4.0.1", "@fullcalendar/daygrid": "4.0.1",
"@fullcalendar/interaction": "4.0.2", "@fullcalendar/interaction": "4.0.2",
"@fullcalendar/timegrid": "4.0.1", "@fullcalendar/timegrid": "4.0.1",
"chart.js": "2.7.3" "chart.js": "2.7.3",
}, "gulp": "^3.9.1",
"dependencies": { "gulp-concat": "^2.6.0",
"gulp-flatten": "^0.2.0",
"gulp-rename": "^1.2.2",
"gulp-uglify": "^1.5.3",
"gulp-uglifycss": "^1.0.6",
"prism-es6": "^1.1.2", "prism-es6": "^1.1.2",
"prismjs": "^1.15.0" "prismjs": "^1.15.0"
} }