mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(cli): publicPath config
This commit is contained in:
parent
41db946d87
commit
e98e4e7ced
@ -17,7 +17,10 @@ export default {
|
||||
|
||||
data() {
|
||||
const { site } = config.build || {};
|
||||
const publicPath = (site && site.publicPath) || '/';
|
||||
const isProd = process.env.NODE_ENV === 'production';
|
||||
const prodPublicPath = (site && site.publicPath) || '/';
|
||||
const publicPath = isProd ? prodPublicPath : '/';
|
||||
|
||||
return {
|
||||
config: config.site,
|
||||
simulator: `${publicPath}mobile.html${location.hash}`
|
||||
|
@ -30,8 +30,6 @@ export const siteDevBaseConfig = merge(baseConfig as any, {
|
||||
}
|
||||
},
|
||||
output: {
|
||||
path: join(__dirname, '../../site/dist'),
|
||||
publicPath: '/',
|
||||
chunkFilename: 'async_[name].js'
|
||||
},
|
||||
optimization: {
|
||||
|
@ -1,13 +1,12 @@
|
||||
import merge from 'webpack-merge';
|
||||
import { get } from 'lodash';
|
||||
import { isDev, getWebpackConfig } from '../common';
|
||||
import { getWebpackConfig } from '../common';
|
||||
import { siteDevBaseConfig } from './webpack.site.dev';
|
||||
import { CONFIG, SITE_DIST_DIR } from '../common/constant';
|
||||
|
||||
const outputDir = get(CONFIG, 'build.site.outputDir', SITE_DIST_DIR);
|
||||
|
||||
// always use '/' as publicPath in dev mode
|
||||
const publicPath = isDev() ? '/' : get(CONFIG, 'build.site.publicPath', '/');
|
||||
const publicPath = get(CONFIG, 'build.site.publicPath', '/');
|
||||
|
||||
export const sitePrdConfig = merge(
|
||||
siteDevBaseConfig,
|
||||
|
Loading…
x
Reference in New Issue
Block a user