提交 aef63a2c authored 作者: zyx's avatar zyx

正在修改

上级 4a4731a0
module.exports = {
demain: 'dev.ezijing.com',
url: 'http://dev.ezijing.com:4002'
// apiBaseURL: '//demo-login.ezijing.com/'
}
module.exports = {
url: 'https://api.ezijing.com',
DesDir: '../client-dist',
apiBaseURL: '//api.ezijing.com/'
}
module.exports = {
url: 'https://login-pbcsf.ezijing.com',
DesDir: '../client-dist',
apiBaseURL: '//login-pbcsf.ezijing.com/'
}
......@@ -3,7 +3,11 @@
"plugins": [
"html"
],
"parser": "babel-eslint",
"parser": "vue-eslint-parser",
"parserOptions": {
"parser": "babel-eslint",
"sourceType": "module"
},
"rules": {
"no-new": "off",
"no-debugger": "off"
......
const isDev = process.env.NODE_ENV === 'development'
const isDev = process.env.NODE_ENV
let config = {
ResName: 'client',
DesName: '../server/client-dist',
HtmlPath: 'client/project/index.html',
JsPath: 'client/project/main.js',
IcoPath: 'client/project/assets/favicon.ico',
isHttps: false,
isDev: isDev,
ResDir: 'src',
DesDir: '../client-dist',
HtmlPath: 'src/index.html',
IcoPath: 'src/assets/favicon.ico',
JsPath: 'src/main.js',
isHttps: true,
CDN_BASE: 'https://zws-imgs-pub.ezijing.com/',
CDN_PATH: 'static/build/learn-mba/',
CDN_DIR: 'static/build/learn-mba/',
isUploadStatic: false,
isUploadStatic: false
webpack: {}
}
if (isDev) {
config.demain = 'dev.ezijing.com'
config.url = 'http://dev.ezijing.com:4002'
let vueClientConfig = {}
config.domain = 'dev.ezijing.com'
if (config.isDev === 'development') {
config.url = 'http://dev.ezijing.com:12002'
try {
vueClientConfig = require('../.config.dev.js')
} catch (error) {
vueClientConfig = {}
console.error('没有开发环境配置文件 -- `.config.dev.js`,正在使用默认配置')
}
} else if(config.isDev === 'test') {
config.url = '//api.ezijing.com'
try {
vueClientConfig = require('../.config.test.js')
} catch (error) {
vueClientConfig = {}
console.error('没有测试环境配置文件 -- `.config.test.js`,正在使用默认配置')
}
} else {
config.url = '//api.ezijing.com'
try {
vueClientConfig = require('../.config.pro.js')
} catch (error) {
vueClientConfig = {}
console.error('没有生产环境配置文件 -- `.config.pro.js`,正在使用默认配置')
}
}
for (let k in vueClientConfig) {
config[k] = vueClientConfig[k]
}
module.exports = config
let fs = require('fs')
let path = require('path')
let OSS = require('ali-oss')
const fs = require('fs')
const path = require('path')
const OSS = require('ali-oss')
const conf = require('./config')
let client = new OSS({
const client = new OSS({
region: 'oss-cn-beijing',
accessKeyId: 'LTAIOTuuLTaWoGJj',
accessKeySecret: 'dE5tTGm2lh35eItct2krW2DeH2lf2I',
bucket: 'zws-imgs-pub'
})
let DIR_PATH = path.join(__dirname, '../' + conf.DesName)
let PREFIX_PATH = conf.CDN_PATH
let DIR_PATH = path.join(__dirname, '../' + conf.DesDir)
let PREFIX_PATH = conf.CDN_DIR
let count = 1
......
const path = require('path')
const webpack = require('webpack')
const WebpackMerge = require('webpack-merge')
const conf = require('./config')
const _conf = require('./config')
const $GLOBAL = {
isDev: process.env.NODE_ENV === 'development',
serverPort: process.env.SERVER_PORT || 8000,
RootPath: path.resolve(__dirname, '../'),
templatePath: path.resolve(__dirname, ('../' + conf.HtmlPath)),
icoPath: conf.IcoPath,
EntryPath: path.resolve(__dirname, ('../' + conf.JsPath)),
OutputPath: path.resolve(__dirname, '../' + conf.DesName),
JsName: 'resources/[name].[chunkhash:8].js',
isDev: _conf.isDev,
ResDir: _conf.ResDir,
templatePath: path.resolve(__dirname, '../' + _conf.HtmlPath),
icoPath: _conf.IcoPath,
EntryPath: path.resolve(__dirname, '../' + _conf.JsPath),
OutputPath: path.resolve(__dirname, '../' + _conf.DesDir),
jsName: 'resources/[name].[chunkhash:8].js',
cssName: 'resources/[name].[contenthash:12].css',
ResPath: 'resources/[name].[hash:8].[ext]',
EntryStaticPath: path.resolve(__dirname, ('../static')),
OutputStaticPath: path.resolve(__dirname, '../' + conf.DesName + '/static'),
BaseConfig: {},
resName: 'resources/[name].[hash:8].[ext]',
EntryStaticPath: path.resolve(__dirname, '../' + 'static'),
OutputStaticPath: path.resolve(__dirname, '../' + _conf.DesDir + '/static'),
webConf: {
'devDomain': conf.url,
'apiBaseURL': '/api',
'CDN_PATH': conf.CDN_BASE + conf.CDN_PATH
}
'isDev': _conf.isDev,
'serverPort': process.env.SERVER_PORT || 8000,
'domain': _conf.domain,
'url': _conf.url,
'isHttps': _conf.isHttps,
'apiBaseURL': _conf.apiBaseURL || '/api',
'CDN_PATH': _conf.CDN_BASE + _conf.CDN_DIR,
'others': _conf.others || {}
},
externals: _conf.webpack.externals || {},
ProvidePlugin: _conf.webpack.ProvidePlugin || {},
BaseConfig: {}
}
$GLOBAL.BaseConfig = {
target: 'web',
entry: $GLOBAL.EntryPath,
output: {
filename: $GLOBAL.JsName,
filename: $GLOBAL.jsName,
path: $GLOBAL.OutputPath,
publicPath: $GLOBAL.isDev ? '/' : $GLOBAL.webConf.CDN_PATH
publicPath: $GLOBAL.isDev === 'development' ? '/' : $GLOBAL.webConf.CDN_PATH
},
resolve: {
alias: {
'@services': path.resolve(__dirname, '../client/components/services'),
'@tools': path.resolve(__dirname, '../client/components/tools'),
'@actions': path.resolve(__dirname, '../client/project/actions')
'@': path.resolve(__dirname, '../' + $GLOBAL.ResDir),
'@api': path.resolve(__dirname, '../' + $GLOBAL.ResDir + '/api'),
'@action': path.resolve(__dirname, '../' + $GLOBAL.ResDir + '/action')
}
},
module: {
......@@ -68,8 +80,9 @@ $GLOBAL.BaseConfig = {
use: {
loader: 'url-loader',
options: {
esModule: false,
limit: 4096,
name: $GLOBAL.ResPath
name: $GLOBAL.resName
}
}
},
......@@ -78,7 +91,7 @@ $GLOBAL.BaseConfig = {
loader: 'url-loader',
options: {
limit: 10000,
name: $GLOBAL.ResPath
name: $GLOBAL.resName
}
},
{
......@@ -86,28 +99,20 @@ $GLOBAL.BaseConfig = {
loader: 'url-loader',
options: {
limit: 10000,
name: $GLOBAL.ResPath
name: $GLOBAL.resName
}
}
]
},
externals: {
},
plugins: [
new webpack.DefinePlugin({
'webConf': JSON.stringify($GLOBAL.webConf)
}),
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'window.jQuery': 'jquery'
})
],
externals: {
'CKEDITOR': 'window.CKEDITOR',
'VideoJs': 'window.swfobject',
'Base64': 'window.Base64',
'sentNotify': 'window.sentNotify',
'Aliplayer': 'window.Aliplayer',
'AliPlayerComponent': 'window.AliPlayerComponent'
}
new webpack.ProvidePlugin($GLOBAL.ProvidePlugin)
]
}
$GLOBAL.BaseConfig = WebpackMerge($GLOBAL.BaseConfig, _conf.webpack)
module.exports = $GLOBAL
const fs = require('fs')
const path = require('path')
const webpack = require('webpack')
const WebpackMerge = require('webpack-merge')
const CleanWebpackPlugin = require('clean-webpack-plugin')
const VueLoaderPlugin = require('vue-loader/lib/plugin')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
const AutoPrefixer = require('autoprefixer')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin')
const cssnano = require('cssnano')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const $GLOBAL = require('./webpack.base.conf')
const _conf = require('./config')
let config = null
if ($GLOBAL.isDev) {
if ($GLOBAL.isDev === 'development') {
config = WebpackMerge($GLOBAL.BaseConfig, {
mode: 'development',
devtool: '#cheap-module-eval-source-map',
......@@ -23,10 +23,13 @@ if ($GLOBAL.isDev) {
filename: '[name].js'
},
devServer: {
port: $GLOBAL.serverPort,
port: $GLOBAL.webConf.serverPort,
disableHostCheck: false,
host: _conf.demain || 'localhost',
https: _conf.isHttps,
host: $GLOBAL.webConf.domain || 'localhost',
https: $GLOBAL.webConf.isHttps && {
key: fs.readFileSync(path.join(__dirname, '../static/cert/dev.ezijing.com.key')),
cert: fs.readFileSync(path.join(__dirname, '../static/cert/dev.ezijing.com.pem'))
},
overlay: {
errors: true
},
......@@ -35,17 +38,17 @@ if ($GLOBAL.isDev) {
},
proxy: {
'/api': {
target: $GLOBAL.webConf.devDomain,
target: $GLOBAL.webConf.url,
selfHandleResponse: false,
secure: false,
changeOrigin: true,
followRedirects: true,
logLevel: 'info',
headers: {
'Referer': $GLOBAL.webConf.devDomain
'Referer': $GLOBAL.webConf.url
},
pathRewrite: {
'^/api': '/api'
'^/api': '/'
}
}
},
......@@ -92,7 +95,7 @@ if ($GLOBAL.isDev) {
mode: 'production',
entry: {
app: $GLOBAL.EntryPath,
vendor: ['vue']
vendor: ['vue', 'vue-router']
},
module: {
rules: [{
......@@ -148,41 +151,7 @@ if ($GLOBAL.isDev) {
}
}
])
],
optimization: {
runtimeChunk: {
name: 'manifest'
},
minimizer: [
new UglifyJsPlugin({
cache: true,
parallel: true,
sourceMap: true
}),
new OptimizeCSSAssetsPlugin({
cssProcessor: cssnano,
cssProcessorOptions: { discardComments: { removeAll: true } },
canPrint: true
})
],
splitChunks: {
chunks: 'async',
minSize: 30000,
minChunks: 1,
maxAsyncRequests: 5,
maxInitialRequests: 3,
name: false,
cacheGroups: {
vendor: {
name: 'vendor',
chunks: 'initial',
priority: -10,
reuseExistingChunk: false,
test: /node_modules\/(.*)\.js/
}
}
}
}
]
})
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论