Commit 7b07604f authored by GuanHua's avatar GuanHua

chore: 修改构建配置,添加文件hash后缀,解决缓存问题

parent dca9d4cf
logs/
output/
output/static
output/Layout.server.js
output/Page.server.js
npm-debug.log
yarn-error.log
node_modules/
......
......@@ -6,6 +6,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent')
const getStyleLoaders = require('./util').getStyleLoaders
const themeVariables = require('./lingxi.theme.config')
const isDev = process.env.NODE_ENV === 'development'
const webpackModule = {
strictExportPresence: true,
......@@ -133,8 +134,8 @@ module.exports = {
module: webpackModule,
plugins: [
new MiniCssExtractPlugin({
filename: 'static/css/[name].css',
chunkFilename: 'static/css/[name].chunk.css'
filename: isDev ? 'static/css/[name].css' : 'static/css/[name].[hash:6].css',
chunkFilename: isDev ? 'static/css/[name].chunk.css' : 'static/css/[name].[hash:6].chunk.css'
}),
],
performance: false
......
......@@ -3,12 +3,26 @@ const isDev = process.env.NODE_ENV === 'development'
const routes = require('./routes')
let injectCss = []
let injectScript = []
if (isDev) {
injectCss.push([
injectCss = [
`/static/css/Page.chunk.css`
])
]
injectScript = [
`<script src='/static/js/runtime~Page.js'></script>`,
`<script src='/static/js/vendor.chunk.js'></script>`,
`<script src='/static/js/Page.chunk.js'></script>`
]
} else {
const assetManifest = require('../output/asset-manifest.json')
injectCss = [
assetManifest['Page.css']
]
injectScript = [
`<script src=${assetManifest['runtime~Page.js']}></script>`,
`<script src=${assetManifest['vendor.js']}></script>`,
`<script src=${assetManifest['Page.js']}></script>`
]
}
module.exports = {
......@@ -16,11 +30,7 @@ module.exports = {
routes: routes,
baseDir: resolvePath('../../../'),
injectCss, // 客户端需要加载的静态样式表
injectScript: [
`<script src='/static/js/runtime~Page.js'></script>`,
`<script src='/static/js/vendor.chunk.js'></script>`,
`<script src='/static/js/Page.chunk.js'></script>`
], // 客户端需要加载的静态资源文件表
injectScript, // 客户端需要加载的静态资源文件表
serverJs: resolvePath(`../output/Page.server.js`),
layout: resolvePath(`../output/Layout.server.js`),
useCDN: false
......
{
"Page.css": "/static/css/Page.6a8ddd.chunk.css",
"Page.js": "/static/js/Page.6a8ddd.chunk.js",
"vendor.js": "/static/js/vendor.6a8ddd.chunk.js",
"runtime~Page.js": "/static/js/runtime~Page.6a8ddd.js",
"static/media/index.less": "/static/media/company_info_bg.13f09ad9.png",
"static/media/default_ad_img.png": "/static/media/default_ad_img.f4b27ac5.png",
"static/media/pay_success.png": "/static/media/pay_success.58ee44a7.png",
"static/media/illus.png": "/static/media/illus.574d91d1.png"
}
\ No newline at end of file
......@@ -94,7 +94,7 @@
"start": "yarn getLocale && concurrently \"npm run ssr\" \"npm run csr\"",
"ssr": "concurrently \"cross-env app=b2b NODE_ENV=development midway-bin dev --ts --entryFile=bootstrap.js \" \"cross-env NODE_ENV=development webpack --watch --config ./build/webpack.config.server.js\"",
"csr": "cross-env app=b2b NODE_ENV=development FE_PORT=6012 ykcli dev",
"build": "midway-bin build -c && npm run build:clean && npm run build:ssr && npm run build:csr",
"build": "midway-bin build -c && npm run build:ssr && npm run build:csr",
"build:ssr": "cross-env app=b2b NODE_ENV=production webpack --config ./build/webpack.config.server.js",
"build:csr": "cross-env app=b2b NODE_ENV=production ykcli build",
"check": "luckyeye",
......
......@@ -107,7 +107,7 @@ const TopBar: SFC<TopBarPropsType> = (props) => {
// 根据接口配置 跳转lx-IM或者七鱼IM,并传入初始秘钥 1 //自有 2 //第三方
const _self = GlobalConfig?.global?.imConfig ? GlobalConfig.global.imConfig.type : null
useEffect(() => {
if(_self === 2) {
if (_self === 2) {
// 接入第三方
const s = GlobalConfig?.global?.imConfig?.paramConfigList[0]['value']
const _window: any = window
......@@ -123,9 +123,9 @@ const TopBar: SFC<TopBarPropsType> = (props) => {
const jumpChatRoom = () => {
if (userInfo) {
if(_self === 1) {
if (_self === 1) {
toChatRoom(memberId, mallInfo.type)
} else if(_self === 2) {
} else if (_self === 2) {
openqiyuIMServer(userInfo);
}
} else {
......
......@@ -73,12 +73,10 @@ class SiteStore implements SiteStoreModal {
]
try {
const res = await getTemplateAdornWebEnterpriseFindColumn(param)
if (res.code === 1000) {
if (res.data && res.data.length > 0) {
this.navList = res.data
} else {
this.navList = defaultNavList
}
if (res.code === 1000 && res.data && res.data.length > 0) {
this.navList = res.data
} else {
this.navList = defaultNavList
}
this.navLoading = false
} catch (error) {
......
logs/
output/
output/static
output/Layout.server.js
output/Page.server.js
npm-debug.log
yarn-error.log
node_modules/
......
......@@ -6,6 +6,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent')
const getStyleLoaders = require('./util').getStyleLoaders
const themeVariables = require('./lingxi.theme.config')
const isDev = process.env.NODE_ENV === 'development'
const webpackModule = {
strictExportPresence: true,
......@@ -133,8 +134,8 @@ module.exports = {
module: webpackModule,
plugins: [
new MiniCssExtractPlugin({
filename: 'static/css/[name].css',
chunkFilename: 'static/css/[name].chunk.css'
filename: isDev ? 'static/css/[name].css' : 'static/css/[name].[hash:6].css',
chunkFilename: isDev ? 'static/css/[name].chunk.css' : 'static/css/[name].[hash:6].chunk.css'
}),
],
performance: false
......
......@@ -109,8 +109,8 @@ module.exports = merge(baseConfig, {
output: {
path: paths.appBuild,
pathinfo: true,
filename: 'static/js/[name].js',
chunkFilename: 'static/js/[name].chunk.js',
filename: isDev ? 'static/js/[name].js' : 'static/js/[name].[hash:6].js',
chunkFilename: isDev ? 'static/js/[name].chunk.js' : 'static/js/[name].[hash:6].chunk.js',
publicPath: publicPath,
hotUpdateChunkFilename: '[hash].hot-update.js',
devtoolModuleFilenameTemplate: info =>
......
const resolvePath = (path) => require('path').resolve(__dirname, path)
const isDev = process.env.NODE_ENV === 'development'
const routes = require('./routes')
module.exports = {
type: 'ssr', // 指定运行类型可设置为csr切换为客户端渲染
routes: routes,
baseDir: resolvePath('../../../'),
injectCss: [
let injectCss = []
let injectScript = []
if (isDev) {
injectCss = [
`/static/css/Page.chunk.css`
], // 客户端需要加载的静态样式表
injectScript: [
]
injectScript = [
`<script src='/static/js/runtime~Page.js'></script>`,
`<script src='/static/js/vendor.chunk.js'></script>`,
`<script src='/static/js/Page.chunk.js'></script>`
], // 客户端需要加载的静态资源文件表
]
} else {
const assetManifest = require('../output/asset-manifest.json')
injectCss = [
assetManifest['Page.css']
]
injectScript = [
`<script src=${assetManifest['runtime~Page.js']}></script>`,
`<script src=${assetManifest['vendor.js']}></script>`,
`<script src=${assetManifest['Page.js']}></script>`
]
}
module.exports = {
type: 'ssr', // 指定运行类型可设置为csr切换为客户端渲染
routes: routes,
baseDir: resolvePath('../../../'),
injectCss, // 客户端需要加载的静态样式表
injectScript, // 客户端需要加载的静态资源文件表
serverJs: resolvePath(`../output/Page.server.js`),
layout: resolvePath(`../output/Layout.server.js`),
useCDN: false
......
{
"Page.css": "/static/css/Page.chunk.css",
"Page.js": "/static/js/Page.chunk.js",
"vendor.js": "/static/js/vendor.chunk.js",
"runtime~Page.js": "/static/js/runtime~Page.js",
"static/media/index.less": "/static/media/company_info_bg.13f09ad9.png",
"static/media/pay_success.png": "/static/media/pay_success.58ee44a7.png"
}
\ No newline at end of file
logs/
output/
output/static
output/Layout.server.js
output/Page.server.js
npm-debug.log
yarn-error.log
node_modules/
......
......@@ -6,6 +6,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent')
const getStyleLoaders = require('./util').getStyleLoaders
const themeVariables = require('./lingxi.theme.config')
const isDev = process.env.NODE_ENV === 'development'
const webpackModule = {
strictExportPresence: true,
......@@ -133,8 +134,8 @@ module.exports = {
module: webpackModule,
plugins: [
new MiniCssExtractPlugin({
filename: 'static/css/[name].css',
chunkFilename: 'static/css/[name].chunk.css'
filename: isDev ? 'static/css/[name].css' : 'static/css/[name].[hash:6].css',
chunkFilename: isDev ? 'static/css/[name].chunk.css' : 'static/css/[name].[hash:6].chunk.css'
}),
],
performance: false
......
......@@ -109,8 +109,8 @@ module.exports = merge(baseConfig, {
output: {
path: paths.appBuild,
pathinfo: true,
filename: 'static/js/[name].js',
chunkFilename: 'static/js/[name].chunk.js',
filename: isDev ? 'static/js/[name].js' : 'static/js/[name].[hash:6].js',
chunkFilename: isDev ? 'static/js/[name].chunk.js' : 'static/js/[name].[hash:6].chunk.js',
publicPath: publicPath,
hotUpdateChunkFilename: '[hash].hot-update.js',
devtoolModuleFilenameTemplate: info =>
......
const resolvePath = (path) => require('path').resolve(__dirname, path)
let injectCss = []
let injectScript = []
if (isDev) {
injectCss = [
`/static/css/Page.chunk.css`
]
injectScript = [
`<script src='/static/js/runtime~Page.js'></script>`,
`<script src='/static/js/vendor.chunk.js'></script>`,
`<script src='/static/js/Page.chunk.js'></script>`
]
} else {
const assetManifest = require('../output/asset-manifest.json')
injectCss = [
assetManifest['Page.css']
]
injectScript = [
`<script src=${assetManifest['runtime~Page.js']}></script>`,
`<script src=${assetManifest['vendor.js']}></script>`,
`<script src=${assetManifest['Page.js']}></script>`
]
}
module.exports = {
type: 'ssr', // 指定运行类型可设置为csr切换为客户端渲染
routes: [
......@@ -40,14 +63,8 @@ module.exports = {
}
],
baseDir: resolvePath('../../../'),
injectCss: [
`/static/css/Page.chunk.css`
], // 客户端需要加载的静态样式表
injectScript: [
`<script src='/static/js/runtime~Page.js'></script>`,
`<script src='/static/js/vendor.chunk.js'></script>`,
`<script src='/static/js/Page.chunk.js'></script>`
], // 客户端需要加载的静态资源文件表
injectCss, // 客户端需要加载的静态样式表
injectScript, // 客户端需要加载的静态资源文件表
serverJs: resolvePath(`../output/Page.server.js`),
layout: resolvePath(`../output/Layout.server.js`),
useCDN: false
......
{
"Page.css": "/static/css/Page.chunk.css",
"Page.js": "/static/js/Page.chunk.js",
"vendor.js": "/static/js/vendor.chunk.js",
"runtime~Page.js": "/static/js/runtime~Page.js",
"static/media/1.png": "/static/media/1.90304721.png"
}
\ No newline at end of file
logs/
output/
output/static
output/Layout.server.js
output/Page.server.js
npm-debug.log
yarn-error.log
node_modules/
......
......@@ -6,6 +6,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent')
const getStyleLoaders = require('./util').getStyleLoaders
const themeVariables = require('./lingxi.theme.config')
const isDev = process.env.NODE_ENV === 'development'
const webpackModule = {
strictExportPresence: true,
......@@ -133,8 +134,8 @@ module.exports = {
module: webpackModule,
plugins: [
new MiniCssExtractPlugin({
filename: 'static/css/[name].css',
chunkFilename: 'static/css/[name].chunk.css'
filename: isDev ? 'static/css/[name].css' : 'static/css/[name].[hash:6].css',
chunkFilename: isDev ? 'static/css/[name].chunk.css' : 'static/css/[name].[hash:6].chunk.css'
}),
],
performance: false
......
......@@ -109,8 +109,8 @@ module.exports = merge(baseConfig, {
output: {
path: paths.appBuild,
pathinfo: true,
filename: 'static/js/[name].js',
chunkFilename: 'static/js/[name].chunk.js',
filename: isDev ? 'static/js/[name].js' : 'static/js/[name].[hash:6].js',
chunkFilename: isDev ? 'static/js/[name].chunk.js' : 'static/js/[name].[hash:6].chunk.js',
publicPath: publicPath,
hotUpdateChunkFilename: '[hash].hot-update.js',
devtoolModuleFilenameTemplate: info =>
......
const resolvePath = (path) => require('path').resolve(__dirname, path)
let injectCss = []
let injectScript = []
if (isDev) {
injectCss = [
`/static/css/Page.chunk.css`
]
injectScript = [
`<script src='/static/js/runtime~Page.js'></script>`,
`<script src='/static/js/vendor.chunk.js'></script>`,
`<script src='/static/js/Page.chunk.js'></script>`
]
} else {
const assetManifest = require('../output/asset-manifest.json')
injectCss = [
assetManifest['Page.css']
]
injectScript = [
`<script src=${assetManifest['runtime~Page.js']}></script>`,
`<script src=${assetManifest['vendor.js']}></script>`,
`<script src=${assetManifest['Page.js']}></script>`
]
}
module.exports = {
type: 'ssr', // 指定运行类型可设置为csr切换为客户端渲染
routes: [
......@@ -26,14 +49,8 @@ module.exports = {
}
],
baseDir: resolvePath('../../../'),
injectCss: [
`/static/css/Page.chunk.css`
], // 客户端需要加载的静态样式表
injectScript: [
`<script src='/static/js/runtime~Page.js'></script>`,
`<script src='/static/js/vendor.chunk.js'></script>`,
`<script src='/static/js/Page.chunk.js'></script>`
], // 客户端需要加载的静态资源文件表
injectCss, // 客户端需要加载的静态样式表
injectScript, // 客户端需要加载的静态资源文件表
serverJs: resolvePath(`../output/Page.server.js`),
layout: resolvePath(`../output/Layout.server.js`),
useCDN: false
......
{
"Page.css": "/static/css/Page.6a8ddd.chunk.css",
"Page.js": "/static/js/Page.6a8ddd.chunk.js",
"vendor.js": "/static/js/vendor.6a8ddd.chunk.js",
"runtime~Page.js": "/static/js/runtime~Page.6a8ddd.js",
"static/media/index.less": "/static/media/company_info_bg.13f09ad9.png",
"static/media/default_ad_img.png": "/static/media/default_ad_img.f4b27ac5.png",
"static/media/pay_success.png": "/static/media/pay_success.58ee44a7.png",
"static/media/illus.png": "/static/media/illus.574d91d1.png"
}
\ No newline at end of file
logs/
output/
output/static
output/Layout.server.js
output/Page.server.js
npm-debug.log
yarn-error.log
node_modules/
......
......@@ -6,6 +6,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent')
const getStyleLoaders = require('./util').getStyleLoaders
const themeVariables = require('./lingxi.theme.config')
const isDev = process.env.NODE_ENV === 'development'
const webpackModule = {
strictExportPresence: true,
......@@ -133,8 +134,8 @@ module.exports = {
module: webpackModule,
plugins: [
new MiniCssExtractPlugin({
filename: 'static/css/[name].css',
chunkFilename: 'static/css/[name].chunk.css'
filename: isDev ? 'static/css/[name].css' : 'static/css/[name].[hash:6].css',
chunkFilename: isDev ? 'static/css/[name].chunk.css' : 'static/css/[name].[hash:6].chunk.css'
}),
],
performance: false
......
......@@ -109,8 +109,8 @@ module.exports = merge(baseConfig, {
output: {
path: paths.appBuild,
pathinfo: true,
filename: 'static/js/[name].js',
chunkFilename: 'static/js/[name].chunk.js',
filename: isDev ? 'static/js/[name].js' : 'static/js/[name].[hash:6].js',
chunkFilename: isDev ? 'static/js/[name].chunk.js' : 'static/js/[name].[hash:6].chunk.js',
publicPath: publicPath,
hotUpdateChunkFilename: '[hash].hot-update.js',
devtoolModuleFilenameTemplate: info =>
......
const resolvePath = (path) => require('path').resolve(__dirname, path)
let injectCss = []
let injectScript = []
if (isDev) {
injectCss = [
`/static/css/Page.chunk.css`
]
injectScript = [
`<script src='/static/js/runtime~Page.js'></script>`,
`<script src='/static/js/vendor.chunk.js'></script>`,
`<script src='/static/js/Page.chunk.js'></script>`
]
} else {
const assetManifest = require('../output/asset-manifest.json')
injectCss = [
assetManifest['Page.css']
]
injectScript = [
`<script src=${assetManifest['runtime~Page.js']}></script>`,
`<script src=${assetManifest['vendor.js']}></script>`,
`<script src=${assetManifest['Page.js']}></script>`
]
}
module.exports = {
type: 'ssr', // 指定运行类型可设置为csr切换为客户端渲染
......@@ -26,14 +48,8 @@ module.exports = {
}
],
baseDir: resolvePath('../../../'),
injectCss: [
`/static/css/Page.chunk.css`
], // 客户端需要加载的静态样式表
injectScript: [
`<script src='/static/js/runtime~Page.js'></script>`,
`<script src='/static/js/vendor.chunk.js'></script>`,
`<script src='/static/js/Page.chunk.js'></script>`
], // 客户端需要加载的静态资源文件表
injectCss, // 客户端需要加载的静态样式表
injectScript, // 客户端需要加载的静态资源文件表
serverJs: resolvePath(`../output/Page.server.js`),
layout: resolvePath(`../output/Layout.server.js`),
useCDN: false
......
{
"Page.css": "/static/css/Page.6a8ddd.chunk.css",
"Page.js": "/static/js/Page.6a8ddd.chunk.js",
"vendor.js": "/static/js/vendor.6a8ddd.chunk.js",
"runtime~Page.js": "/static/js/runtime~Page.6a8ddd.js",
"static/media/index.less": "/static/media/company_info_bg.13f09ad9.png",
"static/media/default_ad_img.png": "/static/media/default_ad_img.f4b27ac5.png",
"static/media/pay_success.png": "/static/media/pay_success.58ee44a7.png",
"static/media/illus.png": "/static/media/illus.574d91d1.png"
}
\ No newline at end of file
logs/
output/
output/static
output/Layout.server.js
output/Page.server.js
npm-debug.log
yarn-error.log
node_modules/
......
......@@ -6,6 +6,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent')
const getStyleLoaders = require('./util').getStyleLoaders
const themeVariables = require('./lingxi.theme.config')
const isDev = process.env.NODE_ENV === 'development'
const webpackModule = {
strictExportPresence: true,
......@@ -133,8 +134,8 @@ module.exports = {
module: webpackModule,
plugins: [
new MiniCssExtractPlugin({
filename: 'static/css/[name].css',
chunkFilename: 'static/css/[name].chunk.css'
filename: isDev ? 'static/css/[name].css' : 'static/css/[name].[hash:6].css',
chunkFilename: isDev ? 'static/css/[name].chunk.css' : 'static/css/[name].[hash:6].chunk.css'
}),
],
performance: false
......
......@@ -109,8 +109,8 @@ module.exports = merge(baseConfig, {
output: {
path: paths.appBuild,
pathinfo: true,
filename: 'static/js/[name].js',
chunkFilename: 'static/js/[name].chunk.js',
filename: isDev ? 'static/js/[name].js' : 'static/js/[name].[hash:6].js',
chunkFilename: isDev ? 'static/js/[name].chunk.js' : 'static/js/[name].[hash:6].chunk.js',
publicPath: publicPath,
hotUpdateChunkFilename: '[hash].hot-update.js',
devtoolModuleFilenameTemplate: info =>
......
const resolvePath = (path) => require('path').resolve(__dirname, path)
const routes = require('./routes')
module.exports = {
type: 'ssr', // 指定运行类型可设置为csr切换为客户端渲染
routes: routes,
baseDir: resolvePath('../../../'),
injectCss: [
let injectCss = []
let injectScript = []
if (isDev) {
injectCss = [
`/static/css/Page.chunk.css`
], // 客户端需要加载的静态样式表
injectScript: [
]
injectScript = [
`<script src='/static/js/runtime~Page.js'></script>`,
`<script src='/static/js/vendor.chunk.js'></script>`,
`<script src='/static/js/Page.chunk.js'></script>`
], // 客户端需要加载的静态资源文件表
]
} else {
const assetManifest = require('../output/asset-manifest.json')
injectCss = [
assetManifest['Page.css']
]
injectScript = [
`<script src=${assetManifest['runtime~Page.js']}></script>`,
`<script src=${assetManifest['vendor.js']}></script>`,
`<script src=${assetManifest['Page.js']}></script>`
]
}
module.exports = {
type: 'ssr', // 指定运行类型可设置为csr切换为客户端渲染
routes: routes,
baseDir: resolvePath('../../../'),
injectCss, // 客户端需要加载的静态样式表
injectScript, // 客户端需要加载的静态资源文件表
serverJs: resolvePath(`../output/Page.server.js`),
layout: resolvePath(`../output/Layout.server.js`),
useCDN: false
......
{
"Page.css": "/static/css/Page.6a8ddd.chunk.css",
"Page.js": "/static/js/Page.6a8ddd.chunk.js",
"vendor.js": "/static/js/vendor.6a8ddd.chunk.js",
"runtime~Page.js": "/static/js/runtime~Page.6a8ddd.js",
"static/media/index.less": "/static/media/company_info_bg.13f09ad9.png",
"static/media/default_ad_img.png": "/static/media/default_ad_img.f4b27ac5.png",
"static/media/pay_success.png": "/static/media/pay_success.58ee44a7.png",
"static/media/illus.png": "/static/media/illus.574d91d1.png"
}
\ No newline at end of file
logs/
output/
output/static
output/Layout.server.js
output/Page.server.js
npm-debug.log
yarn-error.log
node_modules/
......
......@@ -6,6 +6,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent')
const getStyleLoaders = require('./util').getStyleLoaders
const themeVariables = require('./lingxi.theme.config')
const isDev = process.env.NODE_ENV === 'development'
const webpackModule = {
strictExportPresence: true,
......@@ -133,8 +134,8 @@ module.exports = {
module: webpackModule,
plugins: [
new MiniCssExtractPlugin({
filename: 'static/css/[name].css',
chunkFilename: 'static/css/[name].chunk.css'
filename: isDev ? 'static/css/[name].css' : 'static/css/[name].[hash:6].css',
chunkFilename: isDev ? 'static/css/[name].chunk.css' : 'static/css/[name].[hash:6].chunk.css'
}),
],
performance: false
......
......@@ -109,8 +109,8 @@ module.exports = merge(baseConfig, {
output: {
path: paths.appBuild,
pathinfo: true,
filename: 'static/js/[name].js',
chunkFilename: 'static/js/[name].chunk.js',
filename: isDev ? 'static/js/[name].js' : 'static/js/[name].[hash:6].js',
chunkFilename: isDev ? 'static/js/[name].chunk.js' : 'static/js/[name].[hash:6].chunk.js',
publicPath: publicPath,
hotUpdateChunkFilename: '[hash].hot-update.js',
devtoolModuleFilenameTemplate: info =>
......
const resolvePath = (path) => require('path').resolve(__dirname, path)
const routes = require('./routes')
module.exports = {
type: 'ssr', // 指定运行类型可设置为csr切换为客户端渲染
routes: routes,
baseDir: resolvePath('../../../'),
injectCss: [
let injectCss = []
let injectScript = []
if (isDev) {
injectCss = [
`/static/css/Page.chunk.css`
], // 客户端需要加载的静态样式表
injectScript: [
]
injectScript = [
`<script src='/static/js/runtime~Page.js'></script>`,
`<script src='/static/js/vendor.chunk.js'></script>`,
`<script src='/static/js/Page.chunk.js'></script>`
], // 客户端需要加载的静态资源文件表
]
} else {
const assetManifest = require('../output/asset-manifest.json')
injectCss = [
assetManifest['Page.css']
]
injectScript = [
`<script src=${assetManifest['runtime~Page.js']}></script>`,
`<script src=${assetManifest['vendor.js']}></script>`,
`<script src=${assetManifest['Page.js']}></script>`
]
}
module.exports = {
type: 'ssr', // 指定运行类型可设置为csr切换为客户端渲染
routes: routes,
baseDir: resolvePath('../../../'),
injectCss, // 客户端需要加载的静态样式表
injectScript, // 客户端需要加载的静态资源文件表
serverJs: resolvePath(`../output/Page.server.js`),
layout: resolvePath(`../output/Layout.server.js`),
useCDN: false
......
{
"Page.css": "/static/css/Page.chunk.css",
"Page.js": "/static/js/Page.chunk.js",
"vendor.js": "/static/js/vendor.chunk.js",
"runtime~Page.js": "/static/js/runtime~Page.js",
"static/media/pay_success.png": "/static/media/pay_success.58ee44a7.png",
"static/media/illus.png": "/static/media/illus.574d91d1.png"
}
\ No newline at end of file
......@@ -73,12 +73,10 @@ class SiteStore implements SiteStoreModal {
]
try {
const res = await getTemplateAdornWebSelfFindColumn(param)
if (res.code === 1000) {
if (res.data && res.data.length > 0) {
this.navList = res.data
} else {
this.navList = defaultNavList
}
if (res.code === 1000 && res.data && res.data.length > 0) {
this.navList = res.data
} else {
this.navList = defaultNavList
}
this.navLoading = false
} catch (error) {
......
logs/
output/
output/static
output/Layout.server.js
output/Page.server.js
npm-debug.log
yarn-error.log
node_modules/
......
......@@ -6,6 +6,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const getCSSModuleLocalIdent = require('react-dev-utils/getCSSModuleLocalIdent')
const getStyleLoaders = require('./util').getStyleLoaders
const themeVariables = require('./lingxi.theme.config')
const isDev = process.env.NODE_ENV === 'development'
const webpackModule = {
strictExportPresence: true,
......@@ -133,8 +134,8 @@ module.exports = {
module: webpackModule,
plugins: [
new MiniCssExtractPlugin({
filename: 'static/css/[name].css',
chunkFilename: 'static/css/[name].chunk.css'
filename: isDev ? 'static/css/[name].css' : 'static/css/[name].[hash:6].css',
chunkFilename: isDev ? 'static/css/[name].chunk.css' : 'static/css/[name].[hash:6].chunk.css'
}),
],
performance: false
......
......@@ -109,8 +109,8 @@ module.exports = merge(baseConfig, {
output: {
path: paths.appBuild,
pathinfo: true,
filename: 'static/js/[name].js',
chunkFilename: 'static/js/[name].chunk.js',
filename: isDev ? 'static/js/[name].js' : 'static/js/[name].[hash:6].js',
chunkFilename: isDev ? 'static/js/[name].chunk.js' : 'static/js/[name].[hash:6].chunk.js',
publicPath: publicPath,
hotUpdateChunkFilename: '[hash].hot-update.js',
devtoolModuleFilenameTemplate: info =>
......
const resolvePath = (path) => require('path').resolve(__dirname, path)
const routes = require('./routes')
module.exports = {
type: 'ssr', // 指定运行类型可设置为csr切换为客户端渲染
routes: routes,
baseDir: resolvePath('../../../'),
injectCss: [
let injectCss = []
let injectScript = []
if (isDev) {
injectCss = [
`/static/css/Page.chunk.css`
], // 客户端需要加载的静态样式表
injectScript: [
]
injectScript = [
`<script src='/static/js/runtime~Page.js'></script>`,
`<script src='/static/js/vendor.chunk.js'></script>`,
`<script src='/static/js/Page.chunk.js'></script>`
], // 客户端需要加载的静态资源文件表
]
} else {
const assetManifest = require('../output/asset-manifest.json')
injectCss = [
assetManifest['Page.css']
]
injectScript = [
`<script src=${assetManifest['runtime~Page.js']}></script>`,
`<script src=${assetManifest['vendor.js']}></script>`,
`<script src=${assetManifest['Page.js']}></script>`
]
}
module.exports = {
type: 'ssr', // 指定运行类型可设置为csr切换为客户端渲染
routes: routes,
baseDir: resolvePath('../../../'),
injectCss, // 客户端需要加载的静态样式表
injectScript, // 客户端需要加载的静态资源文件表
serverJs: resolvePath(`../output/Page.server.js`),
layout: resolvePath(`../output/Layout.server.js`),
useCDN: false
......
{
"Page.css": "/static/css/Page.6a8ddd.chunk.css",
"Page.js": "/static/js/Page.6a8ddd.chunk.js",
"vendor.js": "/static/js/vendor.6a8ddd.chunk.js",
"runtime~Page.js": "/static/js/runtime~Page.6a8ddd.js",
"static/media/index.less": "/static/media/company_info_bg.13f09ad9.png",
"static/media/default_ad_img.png": "/static/media/default_ad_img.f4b27ac5.png",
"static/media/pay_success.png": "/static/media/pay_success.58ee44a7.png",
"static/media/illus.png": "/static/media/illus.574d91d1.png"
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment