@xarc/app-dev 11.0.10 → 12.0.0
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/config/babel/babelrc-client.js +0 -23
- package/config/babel/babelrc-client.js.map +1 -1
- package/config/babel/babelrc.js +1 -48
- package/config/babel/babelrc.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/package.json +7 -8
- package/src/config/babel/babelrc-client.ts +1 -25
- package/src/config/babel/babelrc.ts +1 -52
|
@@ -63,7 +63,6 @@ const basePlugins = [
|
|
|
63
63
|
],
|
|
64
64
|
];
|
|
65
65
|
const { BABEL_ENV, NODE_ENV, ENABLE_KARMA_COV } = process.env;
|
|
66
|
-
const enableCssModule = Boolean(lodash_1.default.get(xOptions, "webpack.cssModuleSupport"));
|
|
67
66
|
const enableKarmaCov = ENABLE_KARMA_COV === "true";
|
|
68
67
|
const isProduction = (BABEL_ENV || NODE_ENV) === "production";
|
|
69
68
|
// const isTest = (BABEL_ENV || NODE_ENV) === "test";
|
|
@@ -78,28 +77,6 @@ isProduction && [
|
|
|
78
77
|
removeImport: true,
|
|
79
78
|
},
|
|
80
79
|
],
|
|
81
|
-
],
|
|
82
|
-
// css module support
|
|
83
|
-
enableCssModule && [
|
|
84
|
-
[
|
|
85
|
-
"babel-plugin-react-css-modules",
|
|
86
|
-
{
|
|
87
|
-
context: "./src",
|
|
88
|
-
generateScopedName: `${isProduction ? "" : "[name]__[local]___"}[hash:base64:5]`,
|
|
89
|
-
filetypes: {
|
|
90
|
-
".scss": {
|
|
91
|
-
syntax: "postcss-scss",
|
|
92
|
-
plugins: ["postcss-nested"],
|
|
93
|
-
},
|
|
94
|
-
".styl": {
|
|
95
|
-
syntax: "sugarss",
|
|
96
|
-
},
|
|
97
|
-
".less": {
|
|
98
|
-
syntax: "postcss-less",
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
],
|
|
103
80
|
], enableKarmaCov && [
|
|
104
81
|
(0, common_1.getPluginFrom)(["@xarc/opt-karma", "electrode-archetype-opt-karma"], "babel-plugin-istanbul"),
|
|
105
82
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babelrc-client.js","sourceRoot":"","sources":["../../src/config/babel/babelrc-client.ts"],"names":[],"mappings":";AAAA,sGAAsG;;AAEtG,uDAAuD;AACvD,qCAA0D;AAC1D,4DAAuB;AAEvB,MAAM,eAAe,GAAG,IAAA,sCAAmB,EAAC,OAAO,CAAC,CAAC;AACrD,MAAM,OAAO,GAAG,eAAe,CAAC,8BAA8B,CAAC,CAAC;AAChE,MAAM,QAAQ,GAAG,IAAA,wBAAe,EAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAEvD,MAAM,EACJ,gBAAgB,EAChB,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,MAAM,EAAE,WAAW,EACnB,UAAU,GAAG,EAAE,GAChB,GAAG,gBAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;AAEjC,MAAM,aAAa,GAAG,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,CAAC;AAErD,MAAM,WAAW,GAAG;IAClB,6CAA6C;IAC7C;QACE,mBAAmB;QACnB;YACE,QAAQ,EAAE;gBACR,QAAQ,EAAE,IAAI;gBACd,UAAU,EAAE,KAAK;aAClB;YACD,cAAc,EAAE,IAAI;YACpB,gBAAgB,EAAE,IAAI;SACvB;KACF;IACD,uCAAuC;IACvC,wEAAwE;IACxE,CAAC,gBAAgB,IAAI,kBAAkB,CAAC,IAAI;QAC1C,mCAAmC;QACnC,EAAE,MAAM,EAAE,gBAAgB,EAAE,GAAG,kBAAkB,EAAE;KACpD;IACD,EAAE;IACF,gFAAgF;IAChF,4BAA4B;IAC5B,4DAA4D;IAC5D,EAAE;IACF,CAAC,gBAAgB,IAAI,mBAA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ACd,iDAAiD;IACjD;QACE,gDAAgD;QAChD;YACE,YAAY,EAAE,IAAI;SACnB;KACF;CACF,EAED,cAAc,IAAI;IAChB,IAAA,sBAAa,EACX,CAAC,iBAAiB,EAAE,+BAA+B,CAAC,EACpD,uBAAuB,CACxB;CACF,CACF,CAAC;AAEF,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,CAAC;AACxC,MAAM,aAAa,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5E,MAAM,WAAW,GAAG,eAAe;IACjC,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE;IACjD,CAAC,CAAC,EAAE,CAAC;AAEP,MAAM,OAAO,GAAG;IACd,EAAE;IACF,8EAA8E;IAC9E,4CAA4C;IAC5C,iFAAiF;IACjF,mCAAmC;IACnC,EAAE;IACF;QACE,mBAAmB;QACnB;YACE,wEAAwE;YACxE,OAAO,EAAE,CAAC,8BAA8B,EAAE,uBAAuB,CAAC;YAClE,EAAE;YACF,uFAAuF;YACvF,sFAAsF;YACtF,0FAA0F;YAC1F,8BAA8B;YAC9B,EAAE;YACF,sEAAsE;YACtE,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,IAAI;YACX,OAAO;YACP,GAAG,WAAW;SACf;KACF;IACD,gBAAgB,IAAI,0BAA0B;IAC9C,qBAAqB;CACtB,CAAC;AAEF,iBAAS;IACP,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;CAClC,CAAC"}
|
package/config/babel/babelrc.js
CHANGED
|
@@ -17,54 +17,10 @@ const isJest = Boolean(process.env.JEST_WORKER_ID);
|
|
|
17
17
|
const { enableTypeScript, flowRequireDirective, enableFlow, proposalDecorators, legacyDecorators, transformClassProps, looseClassProps, hasMultiTargets, target: babelTarget, envTargets = {}, } = lodash_1.default.get(xOptions, "babel", {});
|
|
18
18
|
const addFlowPlugin = Boolean(enableFlow && optFlow);
|
|
19
19
|
const { BABEL_ENV, NODE_ENV, XARC_BABEL_TARGET, ENABLE_KARMA_COV } = process.env;
|
|
20
|
-
const enableCssModule = (0, common_1.detectCSSModule)(xOptions);
|
|
21
20
|
const enableKarmaCov = ENABLE_KARMA_COV === "true";
|
|
22
21
|
const isProduction = (BABEL_ENV || NODE_ENV) === "production";
|
|
23
22
|
// const isTest = (BABEL_ENV || NODE_ENV) === "test";
|
|
24
23
|
const isNodeTarget = XARC_BABEL_TARGET === "node";
|
|
25
|
-
/**
|
|
26
|
-
* https://www.npmjs.com/package/babel-plugin-react-css-modules
|
|
27
|
-
*
|
|
28
|
-
* This plugin enhances the CSS module support from css-loader. It adds a new
|
|
29
|
-
* prop styleName in addition to the className prop. This also automatically
|
|
30
|
-
* make it work for SSR.
|
|
31
|
-
*
|
|
32
|
-
* Currently, looks like the author has been inactive on maintaining this plugin
|
|
33
|
-
* and there's some compatibility issue with css-loader 4.x.
|
|
34
|
-
* https://github.com/gajus/babel-plugin-react-css-modules/issues/291
|
|
35
|
-
*
|
|
36
|
-
* Resolution: TBD
|
|
37
|
-
*
|
|
38
|
-
* @returns null or settings for babel-plugin-react-css-modules
|
|
39
|
-
*/
|
|
40
|
-
const getReactCssModulePlugin = () => {
|
|
41
|
-
if (!enableCssModule) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
const enableShortenCSSNames = xOptions.webpack.enableShortenCSSNames;
|
|
45
|
-
const enableShortHash = isProduction && enableShortenCSSNames;
|
|
46
|
-
return [
|
|
47
|
-
[
|
|
48
|
-
"babel-plugin-react-css-modules",
|
|
49
|
-
{
|
|
50
|
-
context: "./src",
|
|
51
|
-
generateScopedName: `${enableShortHash ? "" : "[name]__[local]___"}[hash:base64:5]`,
|
|
52
|
-
filetypes: {
|
|
53
|
-
".scss": {
|
|
54
|
-
syntax: "postcss-scss",
|
|
55
|
-
plugins: ["postcss-nested"],
|
|
56
|
-
},
|
|
57
|
-
".styl": {
|
|
58
|
-
syntax: "sugarss",
|
|
59
|
-
},
|
|
60
|
-
".less": {
|
|
61
|
-
syntax: "postcss-less",
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
],
|
|
66
|
-
];
|
|
67
|
-
};
|
|
68
24
|
const basePlugins = [
|
|
69
25
|
// plugin to transpile async/await to Promise
|
|
70
26
|
// not for node.js because it has native async/await
|
|
@@ -131,10 +87,7 @@ const plugins = basePlugins.concat(
|
|
|
131
87
|
removeImport: true,
|
|
132
88
|
},
|
|
133
89
|
],
|
|
134
|
-
],
|
|
135
|
-
// css module support
|
|
136
|
-
// Note: this is needed for server side (node.js) also.
|
|
137
|
-
getReactCssModulePlugin(), !isNodeTarget &&
|
|
90
|
+
], !isNodeTarget &&
|
|
138
91
|
enableKarmaCov && [
|
|
139
92
|
(0, common_1.getPluginFrom)(["@xarc/opt-karma", "electrode-archetype-opt-karma"], "babel-plugin-istanbul"),
|
|
140
93
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"babelrc.js","sourceRoot":"","sources":["../../src/config/babel/babelrc.ts"],"names":[],"mappings":";AAAA,kEAAkE;;AAElE;;;;GAIG;AACH,8DAAyB;AACzB,uDAAuD;AACvD,4DAAuB;AACvB,
|
|
1
|
+
{"version":3,"file":"babelrc.js","sourceRoot":"","sources":["../../src/config/babel/babelrc.ts"],"names":[],"mappings":";AAAA,kEAAkE;;AAElE;;;;GAIG;AACH,8DAAyB;AACzB,uDAAuD;AACvD,4DAAuB;AACvB,qCAA0D;AAE1D,MAAM,eAAe,GAAG,IAAA,sCAAmB,EAAC,OAAO,CAAC,CAAC;AAErD,MAAM,OAAO,GAAG,eAAe,CAAC,8BAA8B,CAAC,CAAC;AAEhE,MAAM,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AC;AACJ,CAAC;AAED,MAAM,WAAW,GACf,CAAC,YAAY,IAAI,eAAe;IAC9B,CAAC,CAAC;QACE,WAAW,EAAE,OAAO;QACpB,MAAM,EAAE,OAAO,CAAC,sBAAsB,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,sBAAsB;KACtF;IACH,CAAC,CAAC,EAAE,CAAC;AAET,MAAM,OAAO,GAAG;IACd,EAAE;IACF,8EAA8E;IAC9E,4CAA4C;IAC5C,iFAAiF;IACjF,mCAAmC;IACnC,EAAE;IACF;QACE,mBAAmB;QACnB;YACE,wEAAwE;YACxE,sEAAsE;YACtE,OAAO,EAAE,CAAC,8BAA8B,EAAE,uBAAuB,CAAC;YAClE,EAAE;YACF,uFAAuF;YACvF,sFAAsF;YACtF,0FAA0F;YAC1F,8BAA8B;YAC9B,EAAE;YACF,sFAAsF;YACtF,OAAO,EAAE,MAAM;YACf,KAAK,EAAE,IAAI;YACX,OAAO;YACP,GAAG,WAAW;SACf;KACF;IACD,gBAAgB,IAAI,0BAA0B;IAC9C,qBAAqB;CACtB,CAAC;AAEF,iBAAS;IACP,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;CAClC,CAAC"}
|
package/lib/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { loadXarcDevTasks } from "./dev-tasks";
|
|
|
2
2
|
export { loadXarcDevTasks, loadXarcDevTasks as loadDevTasks };
|
|
3
3
|
export { xrun, xclap } from "./dev-tasks";
|
|
4
4
|
/** The require from @xarc/app-dev's directory */
|
|
5
|
-
export declare const devRequire:
|
|
5
|
+
export declare const devRequire: NodeJS.Require;
|
|
6
6
|
export { register as hapiPlugin } from "./webpack-dev-hapi";
|
|
7
7
|
export { hapi17Plugin } from "./webpack-dev-hapi17";
|
|
8
8
|
export { fastifyPlugin } from "./webpack-dev-fastify";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xarc/app-dev",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "Electrode X application development support",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"homepage": "http://www.electrode.io",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
"Joel Chen <xchen@walmartlabs.com>"
|
|
29
29
|
],
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@xarc/app": "^
|
|
31
|
+
"@xarc/app": "^12.0.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@babel/cli": "^7.17.10",
|
|
35
35
|
"@babel/core": "^7.17.12",
|
|
36
|
-
"@babel/plugin-transform-class-properties": "^7.24.1",
|
|
37
36
|
"@babel/plugin-proposal-decorators": "^7.17.12",
|
|
37
|
+
"@babel/plugin-transform-class-properties": "^7.24.1",
|
|
38
38
|
"@babel/plugin-transform-object-rest-spread": "^7.24.7",
|
|
39
39
|
"@babel/plugin-transform-react-constant-elements": "^7.17.12",
|
|
40
40
|
"@babel/plugin-transform-react-inline-elements": "^7.16.7",
|
|
@@ -47,11 +47,10 @@
|
|
|
47
47
|
"@xarc/dev-base": "^0.1.3",
|
|
48
48
|
"@xarc/run": "^1.0.5",
|
|
49
49
|
"@xarc/subapp": "^0.4.2",
|
|
50
|
-
"@xarc/webpack": "^
|
|
50
|
+
"@xarc/webpack": "^12.0.0",
|
|
51
51
|
"ansi-to-html": "^0.7.2",
|
|
52
52
|
"babel-plugin-lodash": "^3.3.4",
|
|
53
53
|
"babel-plugin-minify-dead-code-elimination": "^0.5.2",
|
|
54
|
-
"babel-plugin-react-css-modules": "^5.2.6",
|
|
55
54
|
"babel-plugin-transform-node-env-inline": "^0.4.3",
|
|
56
55
|
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
|
57
56
|
"boxen": "^5.0.0",
|
|
@@ -93,6 +92,8 @@
|
|
|
93
92
|
"xsh": "^0.4.5"
|
|
94
93
|
},
|
|
95
94
|
"devDependencies": {
|
|
95
|
+
"@babel/core": "^7.11.0",
|
|
96
|
+
"@babel/eslint-parser": "^7.25.1",
|
|
96
97
|
"@istanbuljs/nyc-config-typescript": "^1.0.2",
|
|
97
98
|
"@types/chai": "^4.3.1",
|
|
98
99
|
"@types/mocha": "^10.0.1",
|
|
@@ -102,11 +103,9 @@
|
|
|
102
103
|
"@types/webpack": "5.28.0",
|
|
103
104
|
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
104
105
|
"@typescript-eslint/parser": "^5.0.0",
|
|
105
|
-
"@xarc/app": "^
|
|
106
|
+
"@xarc/app": "^12.0.0",
|
|
106
107
|
"@xarc/module-dev": "^4.1.0",
|
|
107
108
|
"@xarc/run": "^1.1.1",
|
|
108
|
-
"@babel/eslint-parser": "^7.25.1",
|
|
109
|
-
"@babel/core": "^7.11.0",
|
|
110
109
|
"chai": "^4.3.6",
|
|
111
110
|
"electrode-server": "^3.3.0",
|
|
112
111
|
"electrode-server1": "npm:electrode-server@^1.0.0",
|
|
@@ -79,7 +79,6 @@ const basePlugins = [
|
|
|
79
79
|
|
|
80
80
|
const { BABEL_ENV, NODE_ENV, ENABLE_KARMA_COV } = process.env;
|
|
81
81
|
|
|
82
|
-
const enableCssModule = Boolean(_.get(xOptions, "webpack.cssModuleSupport"));
|
|
83
82
|
const enableKarmaCov = ENABLE_KARMA_COV === "true";
|
|
84
83
|
const isProduction = (BABEL_ENV || NODE_ENV) === "production";
|
|
85
84
|
// const isTest = (BABEL_ENV || NODE_ENV) === "test";
|
|
@@ -96,30 +95,7 @@ const plugins = basePlugins.concat(
|
|
|
96
95
|
},
|
|
97
96
|
],
|
|
98
97
|
],
|
|
99
|
-
|
|
100
|
-
enableCssModule && [
|
|
101
|
-
[
|
|
102
|
-
"babel-plugin-react-css-modules",
|
|
103
|
-
{
|
|
104
|
-
context: "./src",
|
|
105
|
-
generateScopedName: `${
|
|
106
|
-
isProduction ? "" : "[name]__[local]___"
|
|
107
|
-
}[hash:base64:5]`,
|
|
108
|
-
filetypes: {
|
|
109
|
-
".scss": {
|
|
110
|
-
syntax: "postcss-scss",
|
|
111
|
-
plugins: ["postcss-nested"],
|
|
112
|
-
},
|
|
113
|
-
".styl": {
|
|
114
|
-
syntax: "sugarss",
|
|
115
|
-
},
|
|
116
|
-
".less": {
|
|
117
|
-
syntax: "postcss-less",
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
],
|
|
98
|
+
|
|
123
99
|
enableKarmaCov && [
|
|
124
100
|
getPluginFrom(
|
|
125
101
|
["@xarc/opt-karma", "electrode-archetype-opt-karma"],
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import ck from "chalker";
|
|
9
9
|
import { makeOptionalRequire } from "optional-require";
|
|
10
10
|
import _ from "lodash";
|
|
11
|
-
import { getPluginFrom, loadXarcOptions
|
|
11
|
+
import { getPluginFrom, loadXarcOptions } from "./common";
|
|
12
12
|
|
|
13
13
|
const optionalRequire = makeOptionalRequire(require);
|
|
14
14
|
|
|
@@ -36,59 +36,11 @@ const addFlowPlugin = Boolean(enableFlow && optFlow);
|
|
|
36
36
|
const { BABEL_ENV, NODE_ENV, XARC_BABEL_TARGET, ENABLE_KARMA_COV } =
|
|
37
37
|
process.env;
|
|
38
38
|
|
|
39
|
-
const enableCssModule = detectCSSModule(xOptions);
|
|
40
39
|
const enableKarmaCov = ENABLE_KARMA_COV === "true";
|
|
41
40
|
const isProduction = (BABEL_ENV || NODE_ENV) === "production";
|
|
42
41
|
// const isTest = (BABEL_ENV || NODE_ENV) === "test";
|
|
43
42
|
const isNodeTarget = XARC_BABEL_TARGET === "node";
|
|
44
43
|
|
|
45
|
-
/**
|
|
46
|
-
* https://www.npmjs.com/package/babel-plugin-react-css-modules
|
|
47
|
-
*
|
|
48
|
-
* This plugin enhances the CSS module support from css-loader. It adds a new
|
|
49
|
-
* prop styleName in addition to the className prop. This also automatically
|
|
50
|
-
* make it work for SSR.
|
|
51
|
-
*
|
|
52
|
-
* Currently, looks like the author has been inactive on maintaining this plugin
|
|
53
|
-
* and there's some compatibility issue with css-loader 4.x.
|
|
54
|
-
* https://github.com/gajus/babel-plugin-react-css-modules/issues/291
|
|
55
|
-
*
|
|
56
|
-
* Resolution: TBD
|
|
57
|
-
*
|
|
58
|
-
* @returns null or settings for babel-plugin-react-css-modules
|
|
59
|
-
*/
|
|
60
|
-
const getReactCssModulePlugin = (): any => {
|
|
61
|
-
if (!enableCssModule) {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const enableShortenCSSNames = xOptions.webpack.enableShortenCSSNames;
|
|
66
|
-
const enableShortHash = isProduction && enableShortenCSSNames;
|
|
67
|
-
return [
|
|
68
|
-
[
|
|
69
|
-
"babel-plugin-react-css-modules",
|
|
70
|
-
{
|
|
71
|
-
context: "./src",
|
|
72
|
-
generateScopedName: `${
|
|
73
|
-
enableShortHash ? "" : "[name]__[local]___"
|
|
74
|
-
}[hash:base64:5]`,
|
|
75
|
-
filetypes: {
|
|
76
|
-
".scss": {
|
|
77
|
-
syntax: "postcss-scss",
|
|
78
|
-
plugins: ["postcss-nested"],
|
|
79
|
-
},
|
|
80
|
-
".styl": {
|
|
81
|
-
syntax: "sugarss",
|
|
82
|
-
},
|
|
83
|
-
".less": {
|
|
84
|
-
syntax: "postcss-less",
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
|
-
];
|
|
90
|
-
};
|
|
91
|
-
|
|
92
44
|
const basePlugins = [
|
|
93
45
|
// plugin to transpile async/await to Promise
|
|
94
46
|
// not for node.js because it has native async/await
|
|
@@ -157,9 +109,6 @@ const plugins = basePlugins.concat(
|
|
|
157
109
|
},
|
|
158
110
|
],
|
|
159
111
|
],
|
|
160
|
-
// css module support
|
|
161
|
-
// Note: this is needed for server side (node.js) also.
|
|
162
|
-
getReactCssModulePlugin(),
|
|
163
112
|
!isNodeTarget &&
|
|
164
113
|
enableKarmaCov && [
|
|
165
114
|
getPluginFrom(
|