Skip to content

Commit 99adf7f

Browse files
committed
fix: bundle file error on staging
1 parent a6fab6d commit 99adf7f

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

gulpfile.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ function minifyJs(fileName) {
2828
);
2929
}
3030

31-
gulp.task('copyFiles', function () {
31+
gulp.task('copyFiles', function() {
3232

3333
return merge(
3434
gulp.src('static/**/*')
@@ -57,7 +57,7 @@ gulp.task('copyFiles', function () {
5757
gulp.src('src/templates/*').pipe(gulp.dest('app/templates')),
5858
gulp.src(`src/lib/vue-sequence-bundle.*.js`).pipe(gulp.dest('app/lib')),
5959
gulp.src('icons/*').pipe(gulp.dest('app/icons')),
60-
gulp.src(['help.html','ZenUML_Sequence_Diagram_addon_help.html',
60+
gulp.src(['help.html', 'ZenUML_Sequence_Diagram_addon_help.html',
6161
'src/detached-window.js',
6262
'src/icon-16.png',
6363
'src/icon-48.png',
@@ -92,30 +92,31 @@ gulp.task('copyFiles', function () {
9292
'src/Monoid.ttf'
9393
])
9494
.pipe(gulp.dest('app')),
95-
gulp.src('node_modules/vue-sequence/dist/fonts/*').pipe(gulp.dest("app/fonts/"))
95+
gulp.src('node_modules/vue-sequence/dist/fonts/*').pipe(gulp.dest('app/fonts/'))
9696
);
9797
});
9898

9999
// Generate script.js, vendor.js, style.css and vendor.css and index.html under ./app/
100-
gulp.task('useRef', function () {
100+
gulp.task('useRef', function() {
101101
return gulp
102102
.src('build/*.html')
103103
.pipe(useref())
104104
.pipe(gulp.dest('app'));
105105
});
106106

107-
const bundleJs = () => fsUtil.getBundleJs('build')
107+
const bundleJs = () => fsUtil.getBundleJs('build');
108108

109-
gulp.task('concat', function () {
109+
gulp.task('concat', function() {
110110
// TODO: Don't understand what does it do
111111
gulp
112112
.src([`app/${bundleJs()}`])
113113
.pipe(concat(bundleJs()))
114114
.pipe(gulp.dest('app'));
115115
});
116116

117-
gulp.task('minify', function () {
118-
minifyJs(`app/${bundleJs()}`);
117+
gulp.task('minify', function() {
118+
// TODO: don't know why it causes unknown error: `Uncaught IllegalState`
119+
// minifyJs(`app/${bundleJs()}`);
119120
minifyJs('app/lib/screenlog.js');
120121

121122
gulp
@@ -134,7 +135,7 @@ gulp.task('minify', function () {
134135
.pipe(gulp.dest('app'));
135136
});
136137

137-
gulp.task('fixIndex', function () {
138+
gulp.task('fixIndex', function() {
138139
var contents = fs.readFileSync('build/index.html', 'utf8');
139140
// style.css is replaced with style-[hash].css
140141
contents = contents.replace(/style\.css/g, fsUtil.getHashedFile('build', 'style-', 'css'));
@@ -145,7 +146,7 @@ gulp.task('fixIndex', function () {
145146
fs.writeFileSync('build/preview.html', contents, 'utf8');
146147
});
147148

148-
gulp.task('packageExtension', function () {
149+
gulp.task('packageExtension', function() {
149150
childProcess.execSync('cp -R app/ extension');
150151
childProcess.execSync('cp src/manifest.json extension');
151152
childProcess.execSync('cp src/extension/options.js extension');
@@ -171,14 +172,14 @@ gulp.task('packageExtension', function () {
171172
);
172173
});
173174

174-
gulp.task('cleanup', function () {
175+
gulp.task('cleanup', function() {
175176
return childProcess.execSync('rm -rf app extension');
176177
});
177-
gulp.task('cleanup-build', function () {
178+
gulp.task('cleanup-build', function() {
178179
return childProcess.execSync('rm -rf build');
179180
});
180181

181-
gulp.task('release', function (callback) {
182+
gulp.task('release', function(callback) {
182183
runSequence(
183184
'cleanup',
184185
'copyFiles',
@@ -187,7 +188,7 @@ gulp.task('release', function (callback) {
187188
'concat',
188189
'minify',
189190
'packageExtension',
190-
function (error) {
191+
function(error) {
191192
if (error) {
192193
console.log(error.message);
193194
} else {

0 commit comments

Comments
 (0)