gant-core 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli/acorn.js +2 -0
- package/lib/cli/angular.js +2 -0
- package/lib/cli/babel.js +2 -0
- package/lib/cli/config/index.js +1 -1
- package/lib/cli/create/module/index.js +2 -2
- package/lib/cli/estree.js +2 -0
- package/lib/cli/flow.js +2 -0
- package/lib/cli/glimmer.js +2 -0
- package/lib/cli/graphql.js +2 -0
- package/lib/cli/html.js +2 -0
- package/lib/cli/i18n/index.js +2 -2
- package/lib/cli/index.js +1 -1
- package/lib/cli/markdown.js +2 -0
- package/lib/cli/meriyah.js +2 -0
- package/lib/cli/postcss.js +2 -0
- package/lib/cli/typescript.js +2 -0
- package/lib/cli/utils/getJavascriptfile.js +1 -9
- package/lib/cli/utils/index.js +1 -1
- package/lib/cli/webpack/config/default.config.js +1 -1
- package/lib/cli/webpack/config/production.config.js +1 -13
- package/lib/cli/webpack/plugins/index.js +1 -1
- package/lib/cli/yaml.js +2 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +46 -50
- package/rollup.config.js +2 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var e=require("../../utils/index.js"),t=require("html-webpack-plugin"),s=require("./cssRules.js"),r=require("path"),i=require("webpack"),o=require("../../config/index.js");const a=["name","routes","mpas","packages","microServiceMap","base","customHistoryApiFallback","outputPathDir","define","setting","vue","library","compression","terserOptions","htmlTemplatePath","locales","mfa","publicPathDir"];exports.getDefaultConfig=(n,l)=>{const u=o.omit(l,a);let{base:
|
|
2
|
+
"use strict";var e=require("../../utils/index.js"),t=require("html-webpack-plugin"),s=require("./cssRules.js"),r=require("path"),i=require("webpack"),o=require("../../config/index.js");const a=["name","routes","mpas","packages","microServiceMap","base","customHistoryApiFallback","outputPathDir","define","setting","vue","library","compression","terserOptions","htmlTemplatePath","locales","mfa","publicPathDir","provide"];exports.getDefaultConfig=(n,l)=>{const u=o.omit(l,a);let{base:p="/",routes:c,htmlTemplatePath:m,outputPathDir:d="dist",microServiceMap:g,define:h,setting:v,vue:f,provide:y}=o.pick(l,a);p=/^\/.*\/$/.test(p)?p:"/";let b=l.entry||{};const x=[];if(o.isEmpty(b)&&(b.index=r.resolve(n,"src/main")),"string"==typeof b.index){const s=e.getMpasPageHtml(m);x.push(new t({templateContent:s,filename:"index.html",chunks:["index"],publicPath:p,base:p})),l.entry=b}o.isEmpty(b)||Object.entries(b).forEach((([s,r])=>{if("index"!==s){const r=e.getMpasPageHtml(m?.replace("index.",s+"."));x.push(new t({templateContent:r,filename:`${s}.html`,chunks:[s],publicPath:p,base:p}))}}));const P=s.getCssRules(l.mode);return e.mergeConfig({entry:b,stats:"minimal",devServer:{static:{directory:r.resolve(n,"src/.gant/public"),publicPath:p},compress:!0,historyApiFallback:o.has(l,"customHistoryApiFallback")?l?.customHistoryApiFallback:{index:r.resolve(p,"index.html"),rewrites:[{from:/^\/public\/(.*)$/,to:e=>r.resolve(p,e.match[1])}]}},module:{rules:[...f?[{test:/\.vue$/,loader:require.resolve("vue-loader")}]:[],{test:/\.(ts|tsx)$/,exclude:/node_modules/,use:{loader:require.resolve("swc-loader"),options:{jsc:{parser:{syntax:"typescript",tsx:!0,dynamicImport:!0},transform:{...f?{}:{react:{runtime:"automatic",development:"development"===l.mode,refresh:"development"===l.mode}}}}}}},...P,{test:/\.html$/,use:require.resolve("html-loader")},{test:/\.(png|jpg|gif|woff|woff2|eot|ttf|svg)$/i,use:[{loader:require.resolve("url-loader"),options:{limit:8192,name:"[name][hash].[ext]",outputPath:"assets/"}}]}]},resolve:{extensions:[".tsx",".ts",".js",".jsx",".json",".vue"]},output:{path:r.resolve(n,d),publicPath:p,charset:!0,clean:!0},plugins:[...f?[new(require("vue-loader").VueLoaderPlugin)]:[],...x,new i.ProvidePlugin({...y}),new i.ProgressPlugin,new i.DefinePlugin({GANT_START_TIME:JSON.stringify(global.__gant_start_time),microServiceMap:JSON.stringify(g),BASE:JSON.stringify(p),SETTING:JSON.stringify(v||{}),...o.mapValues(h,(e=>JSON.stringify(e))),"process.env":JSON.stringify(process.env)})]},u)};
|