UNPKG

react-app-shell

Version:

react打包脚本和example, 这里的版本请忽略

76 lines (69 loc) 1.93 kB
const fs = require('fs'); const paths = require('./paths'); /* * loki 默认配置 */ const hasLokiConfig = fs.existsSync(paths.lokiConfig); const defaultConfig = { /** * 平台, 默认pc, 可选值: pc, h5 * pc, 不处理px 到 rem 的转换 * mobile, 会添加 px 和 rem 转换 */ platform: 'pc', /** * 别名 * 如何对编辑器友好,详见下面👇 */ alias: { '@': paths.appSrc, }, /** * 静态资源路径, 配置了资源, 则需要手动在html模板里注入js和css * 否则css和js自动注入到html模板 * 'https://static-staging.mmears.cn/shop/', cdn域名+目录 */ resourcePath: { /** * 测试环境 * 使用cdn, 域名+路径 'https://static-staging.mmears.cn/shop/' 作为路径前缀 */ // staging: { // staticPath: "https://static-staging.mmears.cn/shop/", // imgPath: "https://img-staging.mmears.cn/shop/", // mediaPath: "https://media-staging.mmears.cn/shop/" // }, /** * 生产环境 * 使用cdn, 域名+路径 'https://static.mmears.cn/shop/' 作为路径前缀 */ // production: { // staticPath: "https://static.mmears.cn/shop/", // imgPath: "https://img.mmears.cn/shop/", // mediaPath: "https://media.mmears.cn/shop/" // } }, /** * babel配置 */ babelConfig: { plugins: [ // [ // "import", // { // "libraryName": "antd-mobile", // "style": "css" // } // ], ], }, }; let lokiConfig = defaultConfig; if (hasLokiConfig) { const customConfig = require(paths.lokiConfig); lokiConfig = { ...defaultConfig, ...customConfig, }; } module.exports = lokiConfig;