Skip to content

Commit 420119d

Browse files
committed
gulp
1 parent 53ecb87 commit 420119d

7 files changed

Lines changed: 25 additions & 28 deletions

File tree

‎theme/gina/css/common.css‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/gulpfile.js‎

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ gulp.task('sass:watch', function () {
2626
})
2727

2828
gulp.task('clean', ['sass'], function () {
29+
// TODO: editor js
2930
// set static version
3031
const newVersion = (new Date()).getTime()
3132
// set sw.js
@@ -41,21 +42,23 @@ gulp.task('clean', ['sass'], function () {
4142
.pipe(clean())
4243
})
4344

44-
gulp.task('build', ['sass', 'clean'], function (cb) {
45+
gulp.task('build', function (cb) {
4546
const minify = composer(uglifyjs)
4647
// min sw.js
4748
gulp.src('./sw.js')
4849
.pipe(minify().on('error', gulpUtil.log))
4950
.pipe(rename({ suffix: '.min' }))
5051
.pipe(gulp.dest('.'))
51-
// concat js
52-
const eachThemeJS = ['./theme/js/jquery.min.js',
53-
'./theme/js/common.js']
54-
55-
gulp.src(eachThemeJS)
56-
.pipe(minify().on('error', gulpUtil.log))
57-
.pipe(concat('jquery.fileupload.min.js'))
58-
.pipe(gulp.dest('./src/main/webapp/'))
59-
// editor js
52+
// theme js
53+
const commonJS = ['./js/jquery-3.2.1.min.js', './js/common.js']
54+
fs.readdirSync('./x').forEach(function (file) {
55+
const jsPath = `./x/${file}/js/`
56+
let themeJS = [`${jsPath}symbol.js`].concat(commonJS)
57+
themeJS.push(`${jsPath}common.js`)
58+
gulp.src(themeJS)
59+
.pipe(minify().on('error', gulpUtil.log))
60+
.pipe(concat('common.min.js'))
61+
.pipe(gulp.dest(jsPath))
62+
})
6063
})
6164
gulp.task('default', ['sass', 'clean', 'build'])

‎theme/js/jquery-3.2.1.min.js‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/sw.min.js‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/x/gina/footer.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
<span onclick="Util.goTop()" class="icon-goup"></span>
2424
</footer>
2525
{{if eq .conf.RuntimeMode "dev"}}
26-
<script type="text/javascript" src="{{.conf.StaticServer}}/theme/js/js/jquery.min.js" charset="utf-8"></script>
27-
<script type="text/javascript" src="{{.conf.StaticServer}}/theme/js/js/common.js" charset="utf-8"></script>
2826
<script type="text/javascript" src="{{.conf.StaticServer}}/theme/x/{{.setting.themeName}}/js/symbol.js?{{.conf.StaticResourceVersion}}" charset="utf-8"></script>
27+
<script type="text/javascript" src="{{.conf.StaticServer}}/theme/js/jquery-3.2.1.min.js" charset="utf-8"></script>
28+
<script type="text/javascript" src="{{.conf.StaticServer}}/theme/js/common.js" charset="utf-8"></script>
2929
<script type="text/javascript" src="{{.conf.StaticServer}}/theme/x/{{.setting.themeName}}/js/common.js?{{.conf.StaticResourceVersion}}" charset="utf-8"></script>
3030
{{else}}
3131
<script type="text/javascript" src="{{.conf.StaticServer}}/theme/x/{{.setting.themeName}}/js/common.min.js?{{.conf.StaticResourceVersion}}" charset="utf-8"></script>

‎theme/x/gina/js/common.min.js‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎theme/x/gina/js/yilia.min.js‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)