@redhat-cloud-services/frontend-components-config 4.6.35 → 4.6.37
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/package.json +2 -2
- package/src/config.js +1 -1
- package/src/config.test.js +7 -2
- package/src/scripts/build-script.js +1 -3
- package/src/scripts/dev-script.js +1 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redhat-cloud-services/frontend-components-config",
|
|
3
|
-
"version": "4.6.
|
|
3
|
+
"version": "4.6.37",
|
|
4
4
|
"description": "Config plugins and settings for RedHat Cloud Services project.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"homepage": "https://github.com/RedHatInsights/frontend-components/tree/master/packages/config#readme",
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.8",
|
|
24
|
-
"@redhat-cloud-services/frontend-components-config-utilities": "^1.5.
|
|
24
|
+
"@redhat-cloud-services/frontend-components-config-utilities": "^1.5.26",
|
|
25
25
|
"assert": "^2.0.0",
|
|
26
26
|
"axios": "^0.27.2",
|
|
27
27
|
"babel-loader": "^8.2.5",
|
package/src/config.js
CHANGED
|
@@ -44,7 +44,7 @@ module.exports = ({
|
|
|
44
44
|
_unstableHotReload = false,
|
|
45
45
|
resolve = {},
|
|
46
46
|
} = {}) => {
|
|
47
|
-
const filenameMask = `js/[name]
|
|
47
|
+
const filenameMask = `js/[name].${!_unstableHotReload && useFileHash ? `[fullhash].` : ''}js`;
|
|
48
48
|
if (betaEnv) {
|
|
49
49
|
env = `${betaEnv}-beta`;
|
|
50
50
|
console.warn('betaEnv is deprecated in favor of env');
|
package/src/config.test.js
CHANGED
|
@@ -30,10 +30,10 @@ describe('should create dummy config with no options', () => {
|
|
|
30
30
|
|
|
31
31
|
test('output', () => {
|
|
32
32
|
expect(output).toEqual({
|
|
33
|
-
filename: expect.stringMatching(/js\/\[name\]\.\
|
|
33
|
+
filename: expect.stringMatching(/js\/\[name\]\.\[fullhash\]\.js/),
|
|
34
34
|
path: '/dist',
|
|
35
35
|
publicPath: undefined,
|
|
36
|
-
chunkFilename: expect.stringMatching(/js\/\[name\]\.\
|
|
36
|
+
chunkFilename: expect.stringMatching(/js\/\[name\]\.\[fullhash\]\.js/),
|
|
37
37
|
});
|
|
38
38
|
});
|
|
39
39
|
|
|
@@ -120,3 +120,8 @@ test('https', () => {
|
|
|
120
120
|
const { devServer } = configBuilder({ https: true });
|
|
121
121
|
expect(devServer.https).toBe(true);
|
|
122
122
|
});
|
|
123
|
+
|
|
124
|
+
test('noFileHash', () => {
|
|
125
|
+
const { output } = configBuilder({ useFileHash: false });
|
|
126
|
+
expect(output.filename).toBe('js/[name].js');
|
|
127
|
+
});
|
|
@@ -4,16 +4,14 @@ const { spawn } = require('child_process');
|
|
|
4
4
|
|
|
5
5
|
function buildScript(argv, cwd) {
|
|
6
6
|
validateFECConfig(cwd);
|
|
7
|
-
const processArgs = [];
|
|
8
7
|
let configPath;
|
|
9
8
|
if (typeof argv.webpackConfig !== 'undefined') {
|
|
10
9
|
configPath = getWebpackConfigPath(argv.webpackConfig, cwd);
|
|
11
10
|
} else {
|
|
12
11
|
configPath = resolve(__dirname, './prod.webpack.config.js');
|
|
13
12
|
}
|
|
14
|
-
processArgs.push(`node_modules/.bin/webpack -c ${configPath}`);
|
|
15
13
|
process.env.NODE_ENV = 'production';
|
|
16
|
-
const subprocess = spawn(
|
|
14
|
+
const subprocess = spawn(`npm exec -- webpack -c ${configPath}`, [], {
|
|
17
15
|
stdio: [process.stdout, process.stdout, process.stdout],
|
|
18
16
|
cwd,
|
|
19
17
|
shell: true,
|
|
@@ -33,7 +33,6 @@ async function devScript(argv, cwd) {
|
|
|
33
33
|
validateFECConfig(cwd);
|
|
34
34
|
|
|
35
35
|
const fecConfig = require(process.env.FEC_CONFIG_PATH);
|
|
36
|
-
const processArgs = [];
|
|
37
36
|
let configPath;
|
|
38
37
|
if (typeof argv.webpackConfig !== 'undefined') {
|
|
39
38
|
configPath = getWebpackConfigPath(argv.webpackConfig, cwd);
|
|
@@ -41,7 +40,7 @@ async function devScript(argv, cwd) {
|
|
|
41
40
|
configPath = resolve(__dirname, './dev.webpack.config.js');
|
|
42
41
|
}
|
|
43
42
|
await setEnv(cwd);
|
|
44
|
-
spawn(`npm exec -- webpack serve -c ${configPath}`,
|
|
43
|
+
spawn(`npm exec -- webpack serve -c ${configPath}`, [], {
|
|
45
44
|
stdio: [process.stdout, process.stdout, process.stdout],
|
|
46
45
|
cwd,
|
|
47
46
|
shell: true,
|