Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
陈峰
6 years ago
Commit
c71907910d48aead8934bcc03418a22a0ada6b9b
1 parent
36591508
build change
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
3 deletions
manifest.json
package.json
public/build/node-build.js
public/build/postcss.config.js
public/build/webpack.prod.config.js
manifest.json
0 → 100644
View file @
c719079
{}
\ No newline at end of file
...
...
package.json
View file @
c719079
...
...
@@ -9,9 +9,10 @@
},
"scripts"
:
{
"start"
:
"node app.js"
,
"dev"
:
"nodemon -e js,hbs -i public/ app.js"
,
"dev"
:
"nodemon -e js,hbs -i public/
-i dist/
app.js"
,
"static"
:
"webpack-dev-server --config ./public/build/webpack.dev.config.js"
,
"build"
:
"webpack --config ./public/build/webpack.prod.config.js"
,
"build:node"
:
"node ./public/build/node-build.js"
,
"online"
:
"NODE_ENV=\"production\" node app.js"
,
"debug"
:
"DEBUG=\"express:*\" nodemon -e js,hbs -i public/ app.js"
,
"lint-js"
:
"eslint -c .eslintrc --cache --fix ."
,
...
...
public/build/node-build.js
0 → 100644
View file @
c719079
const
shelljs
=
require
(
'shelljs'
);
const
path
=
require
(
'path'
);
const
distDir
=
path
.
join
(
__dirname
,
'../../dist/node'
);
shelljs
.
rm
(
'-rf'
,
distDir
);
shelljs
.
mkdir
(
'-p'
,
distDir
);
const
cpPaths
=
[
'favicon.ico'
,
'.npmrc'
,
'process.json'
,
'Dockerfile'
,
'yarn.lock'
,
'package.json'
,
'*.js'
,
'config'
,
'apps'
,
'doraemon'
,
'mix'
,
'utils'
,
'static'
,
'manifest.json'
];
new
Promise
(
resolve
=>
{
// 加载manifest.json文件
resolve
();
}).
then
(()
=>
{
// 拷贝node代码
cpPaths
.
forEach
(
p
=>
{
let
dist
=
distDir
;
let
file
=
p
;
if
(
typeof
p
===
'object'
)
{
dist
=
path
.
join
(
dist
,
p
[
1
]);
file
=
p
[
0
];
if
(
!
shelljs
.
test
(
'-e'
,
dist
))
{
shelljs
.
mkdir
(
'-p'
,
dist
);
}
}
shelljs
.
cp
(
'-R'
,
path
.
join
(
__dirname
,
'../../'
,
file
),
dist
);
});
}).
then
(()
=>
{
// 安装依赖和清理node_modules
shelljs
.
cd
(
distDir
);
if
(
shelljs
.
exec
(
'yarn --production=true'
).
code
!==
0
)
{
throw
'yarn install faild'
;
}
}).
catch
(
error
=>
{
console
.
error
(
`
error
:
$
{
error
}
`
);
return
process
.
exit
(
1
);
//eslint-disable-line
});
...
...
public/build/postcss.config.js
View file @
c719079
...
...
@@ -18,7 +18,7 @@ const opacity = require('postcss-opacity');
const
spritescore
=
require
(
'postcss-sprites/lib/core'
);
const
config
=
require
(
'../../package.json'
);
const
devInfo
=
require
(
'./dev-info.js'
);
const
distDir
=
path
.
join
(
__dirname
,
`
..
/
dist
/
$
{
config
.
name
}
/${config.version}`
)
;
const
distDir
=
path
.
join
(
__dirname
,
`
..
/
..
/
dist
/
statics
/
$
{
config
.
name
}
/${config.version}`
)
;
const
dist
=
{
img
:
distDir
+
'/img'
,
font
:
distDir
+
'/font'
...
...
public/build/webpack.prod.config.js
View file @
c719079
...
...
@@ -5,7 +5,7 @@ const shelljs = require('shelljs');
const
_
=
require
(
'lodash'
);
const
ExtractTextPlugin
=
require
(
'extract-text-webpack-plugin'
);
const
config
=
require
(
'../../package.json'
);
const
distDir
=
path
.
join
(
__dirname
,
`
..
/
dist
/
$
{
config
.
name
}
/${config.version}`
)
;
const
distDir
=
path
.
join
(
__dirname
,
`
..
/
..
/
dist
/
statics
/
$
{
config
.
name
}
/${config.version}`
)
;
let
baseConfig
=
require
(
'./webpack.base.config.js'
);
// cope img font
...
...
Please
register
or
login
to post a comment