提交 b339cc6b authored 作者: 王鹏飞's avatar 王鹏飞

node-uwla分支为new-chinaelite的代码整合

上级 e6a30879
module.exports = { module.exports = {
domain: 'dev.ezijing.com', domain: 'dev.ezijing.com',
url: 'https://ciis.ezijing.com/api', url: 'https://chinafflg.ezijing.com/api',
isEnableToIphoneDebugger: false, isEnableToIphoneDebugger: false,
// apiBaseURL: '//demo-login.ezijing.com/', apiBaseURL: '/api',
webpack: { webpack: {
externals: { externals: {
CKEDITOR: 'window.CKEDITOR', CKEDITOR: 'window.CKEDITOR',
...@@ -32,7 +32,5 @@ module.exports = { ...@@ -32,7 +32,5 @@ module.exports = {
} }
}, },
ProvidePlugin: {}, ProvidePlugin: {},
others: { others: {}
projectId: '1006'
}
} }
module.exports = { module.exports = {
url: '/api', url: '/',
DesDir: './client-dist', DesDir: './client-dist',
apiBaseURL: '/api', apiBaseURL: '/api',
isUploadStatic: false, isUploadStatic: false,
...@@ -13,7 +13,5 @@ module.exports = { ...@@ -13,7 +13,5 @@ module.exports = {
} }
}, },
ProvidePlugin: {}, ProvidePlugin: {},
others: { others: {}
projectId: '1006'
}
} }
module.exports = { module.exports = {
url: '/api', url: '/',
DesDir: './client-dist', DesDir: './client-dist',
apiBaseURL: '/api', apiBaseURL: '/api',
CDN_DIR: 'static/build/learn-test/',
isUploadStatic: false, isUploadStatic: false,
isEnableToIphoneDebugger: false, isEnableToIphoneDebugger: true,
webpack: { webpack: {
externals: { externals: {
CKEDITOR: 'window.CKEDITOR', CKEDITOR: 'window.CKEDITOR',
...@@ -13,7 +14,5 @@ module.exports = { ...@@ -13,7 +14,5 @@ module.exports = {
} }
}, },
ProvidePlugin: {}, ProvidePlugin: {},
others: { others: {}
projectId: '1006'
}
} }
var semver = require('semver')
var requiredVersion = require('../package.json').engines.node
function checkNodeVersion (wanted, id) {
if (!semver.satisfies(process.version, wanted)) {
console.log('\x1b[91m%s\x1B[0m',
'You are using Node ' + process.version + ', but this version of ' + id +
' requires Node ' + wanted + '.\nPlease upgrade your Node version.'
)
process.exit(1)
}
}
checkNodeVersion(requiredVersion, '`node uploadAliyunCDN.js`')
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.12.0</center>
</body>
</html>
<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.12.0</center>
</body>
</html>
const isDev = process.env.NODE_ENV const isDev = process.env.NODE_ENV
const RegStrs = require('./regExpStr.js')
let config = { let config = {
isDev: isDev, isDev: isDev,
...@@ -21,6 +22,8 @@ let config = { ...@@ -21,6 +22,8 @@ let config = {
webpack: {} webpack: {}
} }
config.RegStrs = RegStrs
let vueClientConfig = {} let vueClientConfig = {}
config.domain = '' config.domain = ''
if (config.isDev === 'development') { if (config.isDev === 'development') {
......
/* 由于正则表达式,不能进行跟 gulpfile 中 去注释 在一起 */
module.exports = {
regExp_static: /('|"|`)[\.|\/]*?static\/(.*?\.(png|jpe?g|gif|svg|ico)(\?.*)?)\1/g
}
const _conf = require('./config')
module.exports = function (source) {
if (_conf.isDev !== 'development') {
return source
.replace(_conf.RegStrs.regExp_static, '$1' + _conf.CDN_BASE + _conf.CDN_DIR + 'static/$2$1')
} else {
return source
}
}
...@@ -22,6 +22,8 @@ const $GLOBAL = { ...@@ -22,6 +22,8 @@ const $GLOBAL = {
EntryStaticPath: path.resolve(__dirname, '../' + 'static'), EntryStaticPath: path.resolve(__dirname, '../' + 'static'),
OutputStaticPath: path.resolve(__dirname, '../' + _conf.DesDir + '/static'), OutputStaticPath: path.resolve(__dirname, '../' + _conf.DesDir + '/static'),
RegStrs: _conf.RegStrs,
webConf: { webConf: {
'isDev': _conf.isDev, 'isDev': _conf.isDev,
'serverPort': process.env.SERVER_PORT || 8000, 'serverPort': process.env.SERVER_PORT || 8000,
...@@ -52,13 +54,20 @@ $GLOBAL.BaseConfig = { ...@@ -52,13 +54,20 @@ $GLOBAL.BaseConfig = {
'@api': path.resolve(__dirname, '../' + $GLOBAL.ResDir + '/api'), '@api': path.resolve(__dirname, '../' + $GLOBAL.ResDir + '/api'),
'@action': path.resolve(__dirname, '../' + $GLOBAL.ResDir + '/action'), '@action': path.resolve(__dirname, '../' + $GLOBAL.ResDir + '/action'),
'@tool': path.resolve(__dirname, '../' + $GLOBAL.ResDir + '/tool') '@tool': path.resolve(__dirname, '../' + $GLOBAL.ResDir + '/tool')
} },
extensions: ['.js', '.json', '.jsx', '.vue']
}, },
module: { module: {
rules: [ rules: [
// {
// test: /\.(vue|js|jsx)$/,
// loader: 'eslint-loader',
// exclude: /node_modules/,
// enforce: 'pre'
// },
{ {
test: /\.(vue|js|jsx)$/, test: /\.(vue|js|jsx)|((sa|sc|c)ss)$/,
loader: 'eslint-loader', loader: './build/stringReplaceLoader.js',
exclude: /node_modules/, exclude: /node_modules/,
enforce: 'pre' enforce: 'pre'
}, },
...@@ -71,10 +80,32 @@ $GLOBAL.BaseConfig = { ...@@ -71,10 +80,32 @@ $GLOBAL.BaseConfig = {
exclude: /(node_modules)|(dist)/, exclude: /(node_modules)|(dist)/,
loader: 'babel-loader', loader: 'babel-loader',
options: { options: {
presets: ['env', 'stage-2'], presets: [[
'@babel/preset-env',
{
"targets": {
"browsers": [
"last 2 versions",
"ie >= 11"
],
},
corejs: '3.6.5',
useBuiltIns: 'usage'
}
]],
plugins: [ plugins: [
'transform-vue-jsx', '@babel/plugin-syntax-jsx',
'syntax-dynamic-import' '@babel/plugin-proposal-class-properties',
'@babel/plugin-syntax-dynamic-import',
[
'@babel/plugin-transform-runtime',
{
corejs: 3,
helpers: true,
regenerator: true,
useESModules: false
}
]
] ]
} }
}, },
......
...@@ -9,6 +9,7 @@ const VueLoaderPlugin = require('vue-loader/lib/plugin') ...@@ -9,6 +9,7 @@ const VueLoaderPlugin = require('vue-loader/lib/plugin')
const AutoPrefixer = require('autoprefixer') const AutoPrefixer = require('autoprefixer')
const MiniCssExtractPlugin = require('mini-css-extract-plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin') const HtmlWebpackPlugin = require('html-webpack-plugin')
const HtmlReplaceWebpackPlugin = require('html-replace-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin') const CopyWebpackPlugin = require('copy-webpack-plugin')
const VconsoleWebpackPlugin = require('vconsole-webpack-plugin') const VconsoleWebpackPlugin = require('vconsole-webpack-plugin')
const $GLOBAL = require('./webpack.base.conf') const $GLOBAL = require('./webpack.base.conf')
...@@ -158,6 +159,12 @@ if ($GLOBAL.isDev === 'development') { ...@@ -158,6 +159,12 @@ if ($GLOBAL.isDev === 'development') {
collapseWhitespace: true collapseWhitespace: true
} }
}), }),
new HtmlReplaceWebpackPlugin([
{
pattern: $GLOBAL.RegStrs.regExp_static,
replacement: '$1' + $GLOBAL.webConf.CDN_PATH + 'static/$2$1'
}
]),
new CopyWebpackPlugin([ new CopyWebpackPlugin([
{ {
from: $GLOBAL.EntryStaticPath, from: $GLOBAL.EntryStaticPath,
...@@ -167,11 +174,11 @@ if ($GLOBAL.isDev === 'development') { ...@@ -167,11 +174,11 @@ if ($GLOBAL.isDev === 'development') {
return content return content
} }
} }
]) ]),
// $GLOBAL.isDev === 'test' && new VconsoleWebpackPlugin({ new VconsoleWebpackPlugin({
// filter: [], filter: [],
// enable: $GLOBAL.isEnableToIphoneDebugger enable: $GLOBAL.isEnableToIphoneDebugger
// }) })
], ],
optimization: { optimization: {
runtimeChunk: { runtimeChunk: {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
差异被折叠。
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论