Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Feature/issue 13 #60

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
module.exports = function (api) {
const isProd = process.env.APPMODE === "production";
api.cache(!isProd);

const generateScopedName = isProd
? "[hash:base64:6]"
: "teams_[path][name]___[local]___[hash:base64:6]";
return {
presets: ["@babel/preset-env", "@babel/preset-react"],
plugins: [
[
"@babel/plugin-transform-runtime",
{
useESModules: true,
regenerator: false,
},
],
[
"react-css-modules",
{
filetypes: {
".scss": {
syntax: "postcss-scss",
},
},
generateScopedName,
},
],
"inline-react-svg",
],
env: {
test: {
presets: [
[
"@babel/preset-env",
{
targets: "current node",
},
],
],
plugins: [
[
"module-resolver",
{
alias: {
styles: "./src/styles",
components: "./src/components",
hooks: "./src/hooks",
utils: "./src/utils",
constants: "./src/constants",
services: "./src/services",
},
},
],
],
},
},
};
};
51 changes: 0 additions & 51 deletions babel.config.json

This file was deleted.

File renamed without changes.
6 changes: 3 additions & 3 deletions config/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* global process */

module.exports = (() => {
const env = process.env.NODE_ENV || "development";
const env = process.env.APPENV || "dev";

// for security reason don't let to require any arbitrary file defined in process.env
if (["production", "development"].indexOf(env) < 0) {
return require("./development");
if (["prod", "dev"].indexOf(env) < 0) {
return require("./dev");
}

return require("./" + env);
Expand Down
File renamed without changes.
5 changes: 4 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ const singleSpaDefaults = require("webpack-config-single-spa-react");
const path = require("path");
const autoprefixer = require("autoprefixer");

const cssLocalIdent = "teams_[path][name]___[local]___[hash:base64:6]";

const cssLocalIdent = process.env.APPMODE === "production"
? "[hash:base64:6]"
: "teams_[path][name]___[local]___[hash:base64:6]";

module.exports = (webpackConfigEnv) => {
const defaultConfig = singleSpaDefaults({
Expand Down