Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dbgame-build
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wildfirecode13
dbgame-build
Commits
3a93f831
Commit
3a93f831
authored
Sep 12, 2018
by
wildfirecode
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
dc6246ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
25 deletions
+43
-25
build.js
build/build.js
+36
-2
index.js
index.js
+6
-22
package.json
package.json
+1
-1
No files found.
build/build.js
View file @
3a93f831
// const publish = require('./publish');
const
ora
=
require
(
'ora'
);
const
rm
=
require
(
'rimraf'
);
const
path
=
require
(
'path'
);
...
...
@@ -48,4 +47,39 @@ let build = opts => {
});
};
module
.
exports
=
build
;
let
buildTS
=
opts
=>
{
if
(
!
opts
.
BUILD_SKIN
)
{
console
.
error
(
'请输入需要构建的项目名称
\
n'
);
return
false
;
}
const
dist
=
path
.
join
(
process
.
cwd
(),
opts
.
BUILD_SKIN
,
'bin-release'
)
rm
(
dist
,
err
=>
{
if
(
err
)
throw
err
;
let
webpackConfig
=
prodConfig
(
opts
);
var
spinner
=
ora
(
'building for production...
\
n'
);
spinner
.
start
();
// 构建
webpack
(
webpackConfig
,
function
(
err
,
stats
)
{
spinner
.
stop
();
if
(
err
)
throw
err
;
process
.
stdout
.
write
(
stats
.
toString
({
colors
:
true
,
modules
:
false
,
children
:
false
,
chunks
:
false
,
chunkModules
:
false
})
+
'
\
n
\
n'
);
console
.
log
(
chalk
.
cyan
(
'Build complete.
\
n'
));
shelljs
.
cd
(
opts
.
BUILD_SKIN
);
shelljs
.
exec
(
'node publish.js'
);
shelljs
.
cd
(
'..'
);
});
});
};
module
.
exports
=
{
build
:
build
,
buildTS
:
buildTS
};
index.js
View file @
3a93f831
const
devServer
=
require
(
'./build/dev-server'
);
const
build
=
require
(
'./build/build'
);
const
build
Obj
=
require
(
'./build/build'
);
// const backup = require('./util/backup');
// const copy = require('./util/copy');
...
...
@@ -38,33 +38,17 @@ class DuibaGameBuild {
devServer
.
start
(
this
.
opts
);
}
/**
* 构建 daily库 dui88环境
* @param {*} skin 皮肤名称
*/
build
(
skin
)
{
this
.
opts
.
sourceMap
=
false
;
this
.
opts
.
daily
=
true
;
this
.
buildBase
(
skin
);
}
/**
* 构建 duiba库 生产环境
* @param {*} skin 皮肤名称
*/
buildProd
(
skin
)
{
this
.
buildBase
(
skin
);
this
.
slicePath
(
skin
);
buildObj
.
build
(
this
.
opts
);
}
/**
* 构建 统一入口
* @param {*} skin 皮肤名称
*/
buildBase
(
skin
)
{
buildProdTS
(
skin
)
{
this
.
slicePath
(
skin
);
build
(
this
.
opts
);
build
Obj
.
buildTS
(
this
.
opts
);
}
/**
* 备份 把skins/下的所有文件复制到backup/下
*/
...
...
package.json
View file @
3a93f831
...
...
@@ -17,5 +17,5 @@
"
co
"
:
"
^4.6.0
"
,
"
progress
"
:
"
^2.0.0
"
},
"version"
:
"0.0.
3
"
"version"
:
"0.0.
5
"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment