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

fix: issue #13 #58

Merged
Merged
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.

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