edon-service
Version:
一个开箱即用的前端构建工具,基于Webpack封装,简化了前端项目的开发与构建流程。无论是开发环境的热更新、资源处理,还是生产环境的代码优化、打包部署,都能提供便捷的配置和稳定的性能
2 lines (1 loc) • 1.27 kB
JavaScript
import{register as n}from"ts-node";import{getDefineConfig as i}from"edon-define";import{joinRoot as t}from"edon-helper";import a from"fs-extra";import f from"portfinder";import{getDotEnvObject as l}from"edon-helper";function e(){return process.env.NODE_ENV==="production"}n({compilerOptions:{module:"CommonJS"}});var o={entryPath:t("src/index.tsx"),outputPath:t("dist"),assetsPath:"assets",publicPath:"/",cdnAddress:"",antdDayjs:!1,autoTypingEnvTypeFile:!0,swagger:[],errorOverlay:!1,extraIncludes:[],forkTSChecker:!1,zipPassword:"123456",devServer:{},http2:!1,limit:10*1024,rem:{enable:!1},styleLoader:!1,cacheDirectory:t("node_modules",".cache","webpack"),statsDirectory:t("node_modules",".edon"),nodePolyfill:!1,legacy:{targets:{chrome:"53",safari:"10"},corejs:"3.24"},svgmin:!0,html:{template:t("public/index.html"),filename:"index.html",hash:e(),inject:"body",minify:{removeComments:e(),collapseWhitespace:e(),removeRedundantAttributes:e(),useShortDoctype:e(),removeEmptyAttributes:e(),removeStyleLinkTypeAttributes:e(),keepClosingSlash:e(),minifyJS:e(),minifyCSS:e(),minifyURLs:e()},chunksSortMode:"auto"}},g=async()=>{let r=await i({});return{...o,...r,rem:{...o.rem,...r.rem},html:{...o.html,...r.html},legacy:{...o.legacy,...r.legacy}}};export{g as getFinalConfig};