This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +66
-55
lines changed Expand file tree Collapse file tree 6 files changed +66
-55
lines changed Original file line number Diff line number Diff line change 1+ module . exports = function ( api ) {
2+ const isProd = process . env . APPMODE === "production" ;
3+ api . cache ( ! isProd ) ;
4+
5+ const generateScopedName = isProd
6+ ? "[hash:base64:6]"
7+ : "teams_[path][name]___[local]___[hash:base64:6]" ;
8+ return {
9+ presets : [ "@babel/preset-env" , "@babel/preset-react" ] ,
10+ plugins : [
11+ [
12+ "@babel/plugin-transform-runtime" ,
13+ {
14+ useESModules : true ,
15+ regenerator : false ,
16+ } ,
17+ ] ,
18+ [
19+ "react-css-modules" ,
20+ {
21+ filetypes : {
22+ ".scss" : {
23+ syntax : "postcss-scss" ,
24+ } ,
25+ } ,
26+ generateScopedName,
27+ } ,
28+ ] ,
29+ "inline-react-svg" ,
30+ ] ,
31+ env : {
32+ test : {
33+ presets : [
34+ [
35+ "@babel/preset-env" ,
36+ {
37+ targets : "current node" ,
38+ } ,
39+ ] ,
40+ ] ,
41+ plugins : [
42+ [
43+ "module-resolver" ,
44+ {
45+ alias : {
46+ styles : "./src/styles" ,
47+ components : "./src/components" ,
48+ hooks : "./src/hooks" ,
49+ utils : "./src/utils" ,
50+ constants : "./src/constants" ,
51+ services : "./src/services" ,
52+ } ,
53+ } ,
54+ ] ,
55+ ] ,
56+ } ,
57+ } ,
58+ } ;
59+ } ;
Load Diff This file was deleted.
File renamed without changes.
Original file line number Diff line number Diff line change 11/* global process */
22
33module . exports = ( ( ) => {
4- const env = process . env . NODE_ENV || "development " ;
4+ const env = process . env . APPENV || "dev " ;
55
66 // for security reason don't let to require any arbitrary file defined in process.env
7- if ( [ "production " , "development " ] . indexOf ( env ) < 0 ) {
8- return require ( "./development " ) ;
7+ if ( [ "prod " , "dev " ] . indexOf ( env ) < 0 ) {
8+ return require ( "./dev " ) ;
99 }
1010
1111 return require ( "./" + env ) ;
File renamed without changes.
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ const singleSpaDefaults = require("webpack-config-single-spa-react");
44const path = require ( "path" ) ;
55const autoprefixer = require ( "autoprefixer" ) ;
66
7- const cssLocalIdent = "teams_[path][name]___[local]___[hash:base64:6]" ;
7+
8+ const cssLocalIdent = process . env . APPMODE === "production"
9+ ? "[hash:base64:6]"
10+ : "teams_[path][name]___[local]___[hash:base64:6]" ;
811
912module . exports = ( webpackConfigEnv ) => {
1013 const defaultConfig = singleSpaDefaults ( {
You can’t perform that action at this time.
0 commit comments