Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
高东东-金蝶建发
/
jf-yzj-deliveryHouseModule
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
698c96f3
authored
Oct 26, 2023
by
golton_gao
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update: 构建优化
parent
5d62fb76
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
5 additions
and
89 deletions
build/build.js
build/vt-build.js
build/webpack.base.conf.js
build/webpack.dev.conf.js
build/webpack.prod.conf.js
build/webpack.prov.conf.js
config/index.js
build/build.js
View file @
698c96f3
...
...
@@ -10,18 +10,6 @@ var webpack = require('webpack')
var
config
=
require
(
'../config'
)
var
webpackConfig
=
require
(
'./webpack.prod.conf'
)
// 设置package.json的name与version跟随config.xml里配置 @add by evanxu 2017-06-29
// 改变package版本号
var
fs
=
require
(
'fs'
)
var
xml2js
=
require
(
'xml2js'
)
var
parser
=
new
xml2js
.
Parser
({
explicitArray
:
false
})
var
versiony
=
require
(
'versiony'
)
var
xml
=
fs
.
readFileSync
(
process
.
cwd
()
+
'/config.xml'
,
{
encoding
:
'utf-8'
}).
toString
()
parser
.
parseString
(
xml
,
(
err
,
result
)
=>
{
if
(
err
)
throw
err
versiony
.
version
(
result
.
widget
.
$
.
version
).
major
().
to
(
'package.json'
)
})
console
.
log
(
chalk
.
yellow
(
' Tip: built files are meant to be served over an HTTP server.\n'
+
' Opening index.html over file:// won\'t work.\n'
...
...
build/vt-build.js
View file @
698c96f3
...
...
@@ -10,18 +10,6 @@ var webpack = require('webpack')
var
config
=
require
(
'../config'
)
var
webpackConfig
=
require
(
'./webpack.prov.conf'
)
// 设置package.json的name与version跟随config.xml里配置 @add by evanxu 2017-06-29
// 改变package版本号
var
fs
=
require
(
'fs'
)
var
xml2js
=
require
(
'xml2js'
)
var
parser
=
new
xml2js
.
Parser
({
explicitArray
:
false
})
var
versiony
=
require
(
'versiony'
)
var
xml
=
fs
.
readFileSync
(
process
.
cwd
()
+
'/config.xml'
,
{
encoding
:
'utf-8'
}).
toString
()
parser
.
parseString
(
xml
,
(
err
,
result
)
=>
{
if
(
err
)
throw
err
versiony
.
version
(
result
.
widget
.
$
.
version
).
major
().
to
(
'package.json'
)
})
console
.
log
(
chalk
.
yellow
(
' Tip: built files are meant to be served over an HTTP server.\n'
+
' Opening index.html over file:// won\'t work.\n'
...
...
build/webpack.base.conf.js
View file @
698c96f3
...
...
@@ -37,10 +37,6 @@ const webpackConfig = {
formatter
:
require
(
'eslint-friendly-formatter'
)
}
},
// {
// test: /\.less$/,
// loader: 'style-loader!css-loader!less-loader'
// },
{
test
:
/
\.
vue$/
,
loader
:
'vue-loader'
,
...
...
build/webpack.dev.conf.js
View file @
698c96f3
...
...
@@ -6,23 +6,6 @@ var baseWebpackConfig = require('./webpack.base.conf')
var
HtmlWebpackPlugin
=
require
(
'html-webpack-plugin'
)
var
FriendlyErrorsPlugin
=
require
(
'friendly-errors-webpack-plugin'
)
// 设置package.json的name与version跟随config.xml里配置 @add by evanxu 2017-06-29
// 设置版本号、时间
var
exdate
=
require
(
'exdate'
)
var
fs
=
require
(
'fs'
)
var
xml2js
=
require
(
'xml2js'
)
var
parser
=
new
xml2js
.
Parser
({
explicitArray
:
false
})
var
xml
=
fs
.
readFileSync
(
process
.
cwd
()
+
'/config.xml'
,
{
encoding
:
'utf-8'
}).
toString
()
var
versions
;
parser
.
parseString
(
xml
,
(
err
,
result
)
=>
{
if
(
err
)
{
throw
err
}
versions
=
result
.
widget
.
$
.
version
})
var
ds
=
new
Date
()
var
dates
=
exdate
.
format
(
ds
,
'yyyy-MM-dd HH:mm'
)
// add hot-reload related code to entry chunks
Object
.
keys
(
baseWebpackConfig
.
entry
).
forEach
(
function
(
name
)
{
baseWebpackConfig
.
entry
[
name
]
=
[
'./build/dev-client'
].
concat
(
baseWebpackConfig
.
entry
[
name
])
...
...
@@ -36,9 +19,7 @@ module.exports = merge(baseWebpackConfig, {
devtool
:
'#cheap-module-eval-source-map'
,
plugins
:
[
new
webpack
.
DefinePlugin
({
'process.env'
:
config
.
dev
.
env
,
'process.vers'
:
JSON
.
stringify
(
versions
),
'process.dates'
:
JSON
.
stringify
(
dates
)
'process.env'
:
config
.
dev
.
env
}),
// https://github.com/glenjamin/webpack-hot-middleware#installation--usage
new
webpack
.
HotModuleReplacementPlugin
(),
...
...
build/webpack.prod.conf.js
View file @
698c96f3
...
...
@@ -9,23 +9,6 @@ var HtmlWebpackPlugin = require('html-webpack-plugin')
var
ExtractTextPlugin
=
require
(
'extract-text-webpack-plugin'
)
var
OptimizeCSSPlugin
=
require
(
'optimize-css-assets-webpack-plugin'
)
// 设置package.json的name与version跟随config.xml里配置 @add by evanxu 2017-06-29
// 设置版本号、时间
var
exdate
=
require
(
'exdate'
)
var
fs
=
require
(
'fs'
)
var
xml2js
=
require
(
'xml2js'
)
var
parser
=
new
xml2js
.
Parser
({
explicitArray
:
false
})
var
xml
=
fs
.
readFileSync
(
process
.
cwd
()
+
'/config.xml'
,
{
encoding
:
'utf-8'
}).
toString
()
var
versions
;
parser
.
parseString
(
xml
,
(
err
,
result
)
=>
{
if
(
err
)
{
throw
err
}
versions
=
result
.
widget
.
$
.
version
})
var
ds
=
new
Date
()
var
dates
=
exdate
.
format
(
ds
,
'yyyy-MM-dd HH:mm'
)
var
env
=
config
.
build
.
env
var
webpackConfig
=
merge
(
baseWebpackConfig
,
{
...
...
@@ -44,9 +27,7 @@ var webpackConfig = merge(baseWebpackConfig, {
plugins
:
[
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new
webpack
.
DefinePlugin
({
'process.env'
:
env
,
'process.vers'
:
JSON
.
stringify
(
versions
),
'process.dates'
:
JSON
.
stringify
(
dates
)
'process.env'
:
env
}),
new
webpack
.
optimize
.
UglifyJsPlugin
({
compress
:
{
...
...
build/webpack.prov.conf.js
View file @
698c96f3
...
...
@@ -10,22 +10,6 @@ var ExtractTextPlugin = require('extract-text-webpack-plugin')
var
ZipPlugin
=
require
(
'zip-webpack-plugin'
)
var
OptimizeCSSPlugin
=
require
(
'optimize-css-assets-webpack-plugin'
)
// 设置版本号、时间
var
exdate
=
require
(
'exdate'
)
var
fs
=
require
(
'fs'
)
var
xml2js
=
require
(
'xml2js'
)
var
parser
=
new
xml2js
.
Parser
({
explicitArray
:
false
})
var
xml
=
fs
.
readFileSync
(
process
.
cwd
()
+
'/config.xml'
,
{
encoding
:
'utf-8'
}).
toString
()
var
versions
;
parser
.
parseString
(
xml
,
(
err
,
result
)
=>
{
if
(
err
)
{
throw
err
}
versions
=
result
.
widget
.
$
.
version
})
var
ds
=
new
Date
()
var
dates
=
exdate
.
format
(
ds
,
'yyyy-MM-dd HH:mm'
)
var
env
=
config
.
prov
.
env
var
webpackConfig
=
merge
(
baseWebpackConfig
,
{
...
...
@@ -44,9 +28,7 @@ var webpackConfig = merge(baseWebpackConfig, {
plugins
:
[
// http://vuejs.github.io/vue-loader/en/workflow/production.html
new
webpack
.
DefinePlugin
({
'process.env'
:
env
,
'process.vers'
:
JSON
.
stringify
(
versions
),
'process.dates'
:
JSON
.
stringify
(
dates
)
'process.env'
:
env
}),
new
webpack
.
optimize
.
UglifyJsPlugin
({
compress
:
{
...
...
config/index.js
View file @
698c96f3
...
...
@@ -7,7 +7,7 @@ module.exports = {
index
:
path
.
resolve
(
__dirname
,
'../www/index.html'
),
assetsRoot
:
path
.
resolve
(
__dirname
,
'../www'
),
assetsSubDirectory
:
'static'
,
assetsPublicPath
:
''
,
assetsPublicPath
:
'
/
'
,
productionSourceMap
:
true
,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
...
...
@@ -41,7 +41,7 @@ module.exports = {
index
:
path
.
resolve
(
__dirname
,
'../dist/index.html'
),
assetsRoot
:
path
.
resolve
(
__dirname
,
'../dist'
),
assetsSubDirectory
:
'static'
,
assetsPublicPath
:
''
,
assetsPublicPath
:
'
/
'
,
productionSourceMap
:
false
,
appConfFile
:
'CubeModule.json'
,
eslint
:
true
,
...
...
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