Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
max_android_panel
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhang Xin
max_android_panel
Commits
44a82eb2
Commit
44a82eb2
authored
May 23, 2019
by
wujiabao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试
parent
9c449c70
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
5 deletions
+34
-5
package.json
+2
-2
webpack.config.js
+32
-3
No files found.
package.json
View file @
44a82eb2
...
@@ -5,11 +5,11 @@
...
@@ -5,11 +5,11 @@
"description"
:
"max_android_panel"
,
"description"
:
"max_android_panel"
,
"main"
:
"index.js"
,
"main"
:
"index.js"
,
"scripts"
:
{
"scripts"
:
{
"test"
:
"
echo
\"
Error: no test specified
\"
&& exit 1
"
,
"test"
:
"
cross-env NODE_ENV=production PAD_ENV=test webpack --env=test --version=2.0.4 --progress --color
"
,
"clean"
:
"rm -rf static/*"
,
"clean"
:
"rm -rf static/*"
,
"start"
:
"cross-env NODE_ENV=development PAD_ENV=development webpack-dev-server --version=2.0.4 --env=dev -d --history-api-fallback --hot --inline --progress --colors --port 6999 --host 0.0.0.0"
,
"start"
:
"cross-env NODE_ENV=development PAD_ENV=development webpack-dev-server --version=2.0.4 --env=dev -d --history-api-fallback --hot --inline --progress --colors --port 6999 --host 0.0.0.0"
,
"build"
:
"cross-env NODE_ENV=production PAD_ENV=production webpack --env=build --version=2.0.4 --progress --color"
,
"build"
:
"cross-env NODE_ENV=production PAD_ENV=production webpack --env=build --version=2.0.4 --progress --color"
,
"preprod"
:
"cross-env NODE_ENV=production PAD_ENV=preprod webpack --env=
buil
d --version=2.0.4 --progress --color"
,
"preprod"
:
"cross-env NODE_ENV=production PAD_ENV=preprod webpack --env=
prepro
d --version=2.0.4 --progress --color"
,
"build:prod"
:
"cross-env NODE_ENV=development webpack --env=build --progress --color"
"build:prod"
:
"cross-env NODE_ENV=development webpack --env=build --progress --color"
},
},
"author"
:
""
,
"author"
:
""
,
...
...
webpack.config.js
View file @
44a82eb2
...
@@ -103,14 +103,43 @@ let envConfig = {
...
@@ -103,14 +103,43 @@ let envConfig = {
new
webpack
.
optimize
.
AggressiveMergingPlugin
(),
new
webpack
.
optimize
.
AggressiveMergingPlugin
(),
new
webpack
.
DefinePlugin
({
new
webpack
.
DefinePlugin
({
'process.env'
:
{
'process.env'
:
{
NODE_ENV
:
JSON
.
stringify
(
process
.
env
.
NODE_ENV
||
'production'
),
NODE_ENV
:
JSON
.
stringify
(
'production'
),
PAD_ENV
:
JSON
.
stringify
(
process
.
env
.
PAD_ENV
||
'production'
)
PAD_ENV
:
JSON
.
stringify
(
'production'
)
},
'BASEREM'
:
120
,
'CURVERSION'
:
JSON
.
stringify
(
curversion
)
}),
new
webpack
.
ProvidePlugin
({
ENV
:
__dirname
+
(
'/client/env/production'
),
UTILPATH
:
__dirname
+
'/client/util/util'
,
CONFIG
:
__dirname
+
'/client/config/index'
,
}),
new
webpack
.
NoEmitOnErrorsPlugin
(),
//配置了NoErrorsPlugin插件,用来跳过编译时出错的代码并记录,使编译后运行时的包不会发生错误
]
},
'preprod'
:{
output
:{
path
:
path
.
join
(
__dirname
,
'./static'
),
filename
:
'bundle-[hash:6].js'
},
plugins
:[
new
webpack
.
optimize
.
UglifyJsPlugin
(),
//js压缩
new
webpack
.
optimize
.
CommonsChunkPlugin
({
name
:
"vendor"
,
filename
:
"vendor.bundle.js"
}),
//分割共有模块和代码模块
new
webpack
.
optimize
.
AggressiveMergingPlugin
(),
new
webpack
.
DefinePlugin
({
'process.env'
:
{
NODE_ENV
:
JSON
.
stringify
(
'production'
),
PAD_ENV
:
JSON
.
stringify
(
'preprod'
)
},
},
'BASEREM'
:
120
,
'BASEREM'
:
120
,
'CURVERSION'
:
JSON
.
stringify
(
curversion
)
'CURVERSION'
:
JSON
.
stringify
(
curversion
)
}),
}),
new
webpack
.
ProvidePlugin
({
new
webpack
.
ProvidePlugin
({
ENV
:
__dirname
+
(
process
.
env
.
PAD_ENV
===
'preprod'
?
'/client/env/preprod'
:
'/client/env/production
'
),
ENV
:
__dirname
+
(
'/client/env/preprod
'
),
UTILPATH
:
__dirname
+
'/client/util/util'
,
UTILPATH
:
__dirname
+
'/client/util/util'
,
CONFIG
:
__dirname
+
'/client/config/index'
,
CONFIG
:
__dirname
+
'/client/config/index'
,
}),
}),
...
...
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