@genesislcap/webpack-builder 14.26.8-alpha-64bb9e2.0 → 14.27.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/dist/commands/build.d.ts +3 -0
- package/dist/commands/build.d.ts.map +1 -0
- package/dist/commands/build.js +22 -0
- package/dist/commands/dev.d.ts +3 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +10 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +5 -0
- package/dist/config/devServer.d.ts +4 -0
- package/dist/config/devServer.d.ts.map +1 -0
- package/dist/config/devServer.js +75 -0
- package/dist/config/entry.d.ts +4 -0
- package/dist/config/entry.d.ts.map +1 -0
- package/dist/config/entry.js +19 -0
- package/dist/config/federation.d.ts +15 -0
- package/dist/config/federation.d.ts.map +1 -0
- package/dist/config/federation.js +69 -0
- package/dist/config/getConfig.d.ts +9 -0
- package/dist/config/getConfig.d.ts.map +1 -0
- package/dist/config/getConfig.js +46 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +4 -0
- package/dist/config/module.d.ts +4 -0
- package/dist/config/module.d.ts.map +1 -0
- package/dist/config/module.js +20 -0
- package/dist/config/optimization.d.ts +4 -0
- package/dist/config/optimization.d.ts.map +1 -0
- package/dist/config/optimization.js +39 -0
- package/dist/config/output.d.ts +4 -0
- package/dist/config/output.d.ts.map +1 -0
- package/dist/config/output.js +34 -0
- package/dist/config/plugins.d.ts +4 -0
- package/dist/config/plugins.d.ts.map +1 -0
- package/dist/config/plugins.js +79 -0
- package/dist/config/resolveLoader.d.ts +4 -0
- package/dist/config/resolveLoader.d.ts.map +1 -0
- package/dist/config/resolveLoader.js +18 -0
- package/dist/{rules → config/rules}/fileRules.d.ts +5 -5
- package/dist/config/rules/fileRules.d.ts.map +1 -0
- package/dist/{rules → config/rules}/fileRules.js +4 -4
- package/dist/{rules → config/rules}/scriptRules.d.ts +3 -4
- package/dist/config/rules/scriptRules.d.ts.map +1 -0
- package/dist/{rules → config/rules}/scriptRules.js +4 -6
- package/dist/{rules → config/rules}/styleRules.d.ts +10 -23
- package/dist/config/rules/styleRules.d.ts.map +1 -0
- package/dist/config/rules/styleRules.js +38 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -9
- package/dist/utils/fs.d.ts +2 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +18 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +4 -0
- package/package.json +5 -4
- package/src/commands/build.ts +24 -0
- package/src/commands/dev.ts +7 -0
- package/src/commands/index.ts +2 -0
- package/src/config/devServer.ts +88 -0
- package/src/config/entry.ts +24 -0
- package/src/config/federation.ts +91 -0
- package/src/config/getConfig.ts +49 -0
- package/src/config/index.ts +1 -0
- package/src/config/module.ts +21 -0
- package/src/config/optimization.ts +45 -0
- package/src/config/output.ts +42 -0
- package/src/config/plugins.ts +95 -0
- package/src/config/resolveLoader.ts +19 -0
- package/src/{rules/fileRules.js → config/rules/fileRules.ts} +1 -5
- package/src/{rules/scriptRules.js → config/rules/scriptRules.ts} +1 -8
- package/src/config/rules/styleRules.ts +38 -0
- package/src/index.ts +10 -9
- package/src/utils/fs.ts +13 -0
- package/src/utils/index.ts +1 -0
- package/dist/config/configFactory.d.ts +0 -7
- package/dist/config/configFactory.d.ts.map +0 -1
- package/dist/config/configFactory.js +0 -51
- package/dist/config/devServers.d.ts +0 -35
- package/dist/config/devServers.d.ts.map +0 -1
- package/dist/config/devServers.js +0 -67
- package/dist/config/postcss.config.d.ts +0 -2
- package/dist/config/postcss.config.d.ts.map +0 -1
- package/dist/config/postcss.config.js +0 -8
- package/dist/config/utils.d.ts +0 -20
- package/dist/config/utils.d.ts.map +0 -1
- package/dist/config/utils.js +0 -77
- package/dist/config/webpack.common.d.ts +0 -68
- package/dist/config/webpack.common.d.ts.map +0 -1
- package/dist/config/webpack.common.js +0 -106
- package/dist/config/webpack.dev.d.ts +0 -68
- package/dist/config/webpack.dev.d.ts.map +0 -1
- package/dist/config/webpack.dev.js +0 -31
- package/dist/config/webpack.prod.d.ts +0 -68
- package/dist/config/webpack.prod.d.ts.map +0 -1
- package/dist/config/webpack.prod.js +0 -43
- package/dist/rules/fileRules.d.ts.map +0 -1
- package/dist/rules/scriptRules.d.ts.map +0 -1
- package/dist/rules/styleRules.d.ts.map +0 -1
- package/dist/rules/styleRules.js +0 -53
- package/public/cert/README.md +0 -17
- package/public/cert/localhost.crt +0 -25
- package/public/cert/localhost.key +0 -28
- package/src/config/configFactory.js +0 -56
- package/src/config/devServers.js +0 -73
- package/src/config/postcss.config.js +0 -8
- package/src/config/utils.js +0 -99
- package/src/config/webpack.common.js +0 -109
- package/src/config/webpack.dev.js +0 -32
- package/src/config/webpack.prod.js +0 -47
- package/src/rules/styleRules.js +0 -60
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const CopyPlugin = require('copy-webpack-plugin');
|
|
3
|
-
const fs = require('fs-extra');
|
|
4
|
-
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
5
|
-
const { DefinePlugin, ProgressPlugin } = require('webpack');
|
|
6
|
-
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
|
|
7
|
-
const { appFileRules } = require('../rules/fileRules');
|
|
8
|
-
const { appScriptRules } = require('../rules/scriptRules');
|
|
9
|
-
const { appStyleRules } = require('../rules/styleRules');
|
|
10
|
-
const readFile = (filePath) => {
|
|
11
|
-
if (!filePath)
|
|
12
|
-
return '';
|
|
13
|
-
const configPath = path.resolve(process.cwd(), filePath);
|
|
14
|
-
try {
|
|
15
|
-
return fs.readFileSync(configPath, 'utf8');
|
|
16
|
-
}
|
|
17
|
-
catch (e) {
|
|
18
|
-
console.error(e);
|
|
19
|
-
return '';
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
/**
|
|
23
|
-
* Switching the '/' instead of 'auto', as webpack and perhaps the html-webpack-plugin seem to get confused over
|
|
24
|
-
* mime types, and this can block deep linking. Reading through the 'Practical Module Federation' guide, we may need
|
|
25
|
-
* to revisit this, dev v prod, resolving remotes.
|
|
26
|
-
*/
|
|
27
|
-
const publicPath = typeof process.env.PUBLIC_PATH !== 'undefined' ? process.env.PUBLIC_PATH : '/';
|
|
28
|
-
/**
|
|
29
|
-
* Webpack common config factory used as a baseline across both production and development builds.
|
|
30
|
-
* Used mainly in conjunction with ./configFactory.js, but there are a few standalone consumers in foundation-ui.
|
|
31
|
-
*
|
|
32
|
-
* @returns A common webpack config.
|
|
33
|
-
*/
|
|
34
|
-
module.exports = () => ({
|
|
35
|
-
entry: path.resolve(process.cwd(), './src/index.ts'),
|
|
36
|
-
plugins: [
|
|
37
|
-
new CopyPlugin({
|
|
38
|
-
patterns: [
|
|
39
|
-
{
|
|
40
|
-
from: path.resolve(__dirname, '../public'),
|
|
41
|
-
},
|
|
42
|
-
],
|
|
43
|
-
}),
|
|
44
|
-
/**
|
|
45
|
-
* TODO: Test making this dynamic using .env files and the DotEnv Webpack plugin.
|
|
46
|
-
*/
|
|
47
|
-
new DefinePlugin({
|
|
48
|
-
API_HOST: JSON.stringify(process.env.API_HOST),
|
|
49
|
-
DEFAULT_ORGANISATION: JSON.stringify(process.env.DEFAULT_ORGANISATION),
|
|
50
|
-
DEFAULT_USER: JSON.stringify(process.env.DEFAULT_USER),
|
|
51
|
-
DEFAULT_PASSWORD: JSON.stringify(process.env.DEFAULT_PASSWORD),
|
|
52
|
-
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
|
|
53
|
-
FORCE_HTTP: JSON.stringify(process.env.FORCE_HTTP),
|
|
54
|
-
HTTP_CONFIG: JSON.stringify(readFile(process.env.HTTP_CONFIG_PATH)),
|
|
55
|
-
SOCKET_EXT: JSON.stringify(process.env.SOCKET_EXT),
|
|
56
|
-
}),
|
|
57
|
-
new ProgressPlugin(),
|
|
58
|
-
new MiniCssExtractPlugin(),
|
|
59
|
-
/**
|
|
60
|
-
* Run via 'build:webpack:stats'.
|
|
61
|
-
*/
|
|
62
|
-
...(process.env.ANALYZE
|
|
63
|
-
? [
|
|
64
|
-
new BundleAnalyzerPlugin({
|
|
65
|
-
reportTitle: `Webpack Visualizer`,
|
|
66
|
-
reportFilename: path.join(process.cwd(), './dist', 'webpack.stats.html'),
|
|
67
|
-
analyzerMode: 'static',
|
|
68
|
-
openAnalyzer: false,
|
|
69
|
-
}),
|
|
70
|
-
]
|
|
71
|
-
: []),
|
|
72
|
-
],
|
|
73
|
-
output: {
|
|
74
|
-
strictModuleErrorHandling: true,
|
|
75
|
-
strictModuleExceptionHandling: true,
|
|
76
|
-
path: path.resolve(process.cwd(), './dist'),
|
|
77
|
-
publicPath,
|
|
78
|
-
},
|
|
79
|
-
resolve: {
|
|
80
|
-
extensions: ['.ts', '.js'],
|
|
81
|
-
modules: ['node_modules'],
|
|
82
|
-
},
|
|
83
|
-
module: {
|
|
84
|
-
rules: [
|
|
85
|
-
appScriptRules.typescript(),
|
|
86
|
-
// Files
|
|
87
|
-
appFileRules.fonts(),
|
|
88
|
-
appFileRules.html(),
|
|
89
|
-
appFileRules.images(),
|
|
90
|
-
// Styles
|
|
91
|
-
appStyleRules.headCss(),
|
|
92
|
-
appStyleRules.css(),
|
|
93
|
-
appStyleRules.sass(),
|
|
94
|
-
],
|
|
95
|
-
},
|
|
96
|
-
experiments: {
|
|
97
|
-
topLevelAwait: true,
|
|
98
|
-
lazyCompilation: false,
|
|
99
|
-
// outputModule: true,
|
|
100
|
-
},
|
|
101
|
-
performance: {
|
|
102
|
-
hints: false,
|
|
103
|
-
maxEntrypointSize: 512000,
|
|
104
|
-
maxAssetSize: 512000,
|
|
105
|
-
},
|
|
106
|
-
});
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
declare function _exports(port?: any): {
|
|
2
|
-
entry: string;
|
|
3
|
-
plugins: any[];
|
|
4
|
-
output: {
|
|
5
|
-
strictModuleErrorHandling: boolean;
|
|
6
|
-
strictModuleExceptionHandling: boolean;
|
|
7
|
-
path: string;
|
|
8
|
-
publicPath: string;
|
|
9
|
-
};
|
|
10
|
-
resolve: {
|
|
11
|
-
extensions: string[];
|
|
12
|
-
modules: string[];
|
|
13
|
-
};
|
|
14
|
-
module: {
|
|
15
|
-
rules: ({
|
|
16
|
-
test: RegExp;
|
|
17
|
-
type: string;
|
|
18
|
-
} | {
|
|
19
|
-
test: RegExp;
|
|
20
|
-
use: {
|
|
21
|
-
loader: string;
|
|
22
|
-
}[];
|
|
23
|
-
} | {
|
|
24
|
-
test: RegExp;
|
|
25
|
-
include: RegExp[];
|
|
26
|
-
use: (string | {
|
|
27
|
-
loader: string;
|
|
28
|
-
options: {
|
|
29
|
-
importLoaders: number;
|
|
30
|
-
};
|
|
31
|
-
} | {
|
|
32
|
-
loader: string;
|
|
33
|
-
options: {
|
|
34
|
-
postcssOptions: {
|
|
35
|
-
config: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
})[];
|
|
39
|
-
} | {
|
|
40
|
-
test: RegExp;
|
|
41
|
-
exclude: RegExp[];
|
|
42
|
-
use: (string | {
|
|
43
|
-
loader: string;
|
|
44
|
-
options: {
|
|
45
|
-
importLoaders: number;
|
|
46
|
-
};
|
|
47
|
-
} | {
|
|
48
|
-
loader: string;
|
|
49
|
-
options: {
|
|
50
|
-
postcssOptions: {
|
|
51
|
-
config: string;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
})[];
|
|
55
|
-
})[];
|
|
56
|
-
};
|
|
57
|
-
experiments: {
|
|
58
|
-
topLevelAwait: boolean;
|
|
59
|
-
lazyCompilation: boolean;
|
|
60
|
-
};
|
|
61
|
-
performance: {
|
|
62
|
-
hints: boolean;
|
|
63
|
-
maxEntrypointSize: number;
|
|
64
|
-
maxAssetSize: number;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
export = _exports;
|
|
68
|
-
//# sourceMappingURL=webpack.dev.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.dev.d.ts","sourceRoot":"","sources":["../../src/config/webpack.dev.js"],"names":[],"mappings":"AAYiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBhB"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
const portfinderSync = require('portfinder-sync');
|
|
2
|
-
const { merge } = require('webpack-merge');
|
|
3
|
-
const { devServers } = require('./devServers.js');
|
|
4
|
-
const commonConfigFactory = require('./webpack.common.js');
|
|
5
|
-
/**
|
|
6
|
-
* Webpack config factory for development.
|
|
7
|
-
* Used mainly in conjunction with ./configFactory.js, but there are a few standalone consumers in foundation-ui.
|
|
8
|
-
*
|
|
9
|
-
* @param port the target port to use.
|
|
10
|
-
* @returns Webpack config for development mode.
|
|
11
|
-
*/
|
|
12
|
-
module.exports = (port = portfinderSync.getPort(process.env.PORT || 9000)) => {
|
|
13
|
-
return merge(commonConfigFactory(), {
|
|
14
|
-
mode: 'development',
|
|
15
|
-
devtool: 'inline-source-map',
|
|
16
|
-
output: {
|
|
17
|
-
filename: '[name].js',
|
|
18
|
-
chunkFilename: '[name].[id].js',
|
|
19
|
-
sourceMapFilename: '[name].js.map',
|
|
20
|
-
// library: {
|
|
21
|
-
// // no name required for module
|
|
22
|
-
// type: 'module',
|
|
23
|
-
// },
|
|
24
|
-
},
|
|
25
|
-
devServer: devServers.default(port),
|
|
26
|
-
optimization: {
|
|
27
|
-
usedExports: false,
|
|
28
|
-
minimize: false,
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
declare function _exports(): {
|
|
2
|
-
entry: string;
|
|
3
|
-
plugins: any[];
|
|
4
|
-
output: {
|
|
5
|
-
strictModuleErrorHandling: boolean;
|
|
6
|
-
strictModuleExceptionHandling: boolean;
|
|
7
|
-
path: string;
|
|
8
|
-
publicPath: string;
|
|
9
|
-
};
|
|
10
|
-
resolve: {
|
|
11
|
-
extensions: string[];
|
|
12
|
-
modules: string[];
|
|
13
|
-
};
|
|
14
|
-
module: {
|
|
15
|
-
rules: ({
|
|
16
|
-
test: RegExp;
|
|
17
|
-
type: string;
|
|
18
|
-
} | {
|
|
19
|
-
test: RegExp;
|
|
20
|
-
use: {
|
|
21
|
-
loader: string;
|
|
22
|
-
}[];
|
|
23
|
-
} | {
|
|
24
|
-
test: RegExp;
|
|
25
|
-
include: RegExp[];
|
|
26
|
-
use: (string | {
|
|
27
|
-
loader: string;
|
|
28
|
-
options: {
|
|
29
|
-
importLoaders: number;
|
|
30
|
-
};
|
|
31
|
-
} | {
|
|
32
|
-
loader: string;
|
|
33
|
-
options: {
|
|
34
|
-
postcssOptions: {
|
|
35
|
-
config: string;
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
})[];
|
|
39
|
-
} | {
|
|
40
|
-
test: RegExp;
|
|
41
|
-
exclude: RegExp[];
|
|
42
|
-
use: (string | {
|
|
43
|
-
loader: string;
|
|
44
|
-
options: {
|
|
45
|
-
importLoaders: number;
|
|
46
|
-
};
|
|
47
|
-
} | {
|
|
48
|
-
loader: string;
|
|
49
|
-
options: {
|
|
50
|
-
postcssOptions: {
|
|
51
|
-
config: string;
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
})[];
|
|
55
|
-
})[];
|
|
56
|
-
};
|
|
57
|
-
experiments: {
|
|
58
|
-
topLevelAwait: boolean;
|
|
59
|
-
lazyCompilation: boolean;
|
|
60
|
-
};
|
|
61
|
-
performance: {
|
|
62
|
-
hints: boolean;
|
|
63
|
-
maxEntrypointSize: number;
|
|
64
|
-
maxAssetSize: number;
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
export = _exports;
|
|
68
|
-
//# sourceMappingURL=webpack.prod.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"webpack.prod.d.ts","sourceRoot":"","sources":["../../src/config/webpack.prod.js"],"names":[],"mappings":"AAwBiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAsBhB"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/* eslint prefer-named-capture-group: "off" */
|
|
2
|
-
// In this config named capturing isn't desired.
|
|
3
|
-
// May cause adverse affects with webpack.
|
|
4
|
-
const TerserPlugin = require('terser-webpack-plugin');
|
|
5
|
-
const { merge } = require('webpack-merge');
|
|
6
|
-
const commonConfigFactory = require('./webpack.common.js');
|
|
7
|
-
const vendorCacheGroup = {
|
|
8
|
-
vendor: {
|
|
9
|
-
test: /[\\/]node_modules[\\/]/,
|
|
10
|
-
name: (module) => {
|
|
11
|
-
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1];
|
|
12
|
-
// npm package names are URL-safe, but some servers don't like @ symbols
|
|
13
|
-
return `npm.${packageName.replace('@', '')}`;
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Webpack config factory for production.
|
|
19
|
-
* Used mainly in conjunction with ./configFactory.js, but there are a few standalone consumers in foundation-ui.
|
|
20
|
-
*
|
|
21
|
-
* @returns Webpack config for production mode.
|
|
22
|
-
*/
|
|
23
|
-
module.exports = () => {
|
|
24
|
-
return merge(commonConfigFactory(), {
|
|
25
|
-
mode: 'production',
|
|
26
|
-
devtool: 'source-map',
|
|
27
|
-
output: {
|
|
28
|
-
filename: '[name].[contenthash].js',
|
|
29
|
-
chunkFilename: '[name].[id].[contenthash].js',
|
|
30
|
-
sourceMapFilename: '[name].[contenthash].js.map',
|
|
31
|
-
},
|
|
32
|
-
optimization: {
|
|
33
|
-
usedExports: true,
|
|
34
|
-
minimize: true,
|
|
35
|
-
minimizer: [new TerserPlugin()],
|
|
36
|
-
splitChunks: {
|
|
37
|
-
chunks: 'all',
|
|
38
|
-
maxInitialRequests: 100,
|
|
39
|
-
cacheGroups: Object.assign({}, vendorCacheGroup),
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fileRules.d.ts","sourceRoot":"","sources":["../../src/rules/fileRules.js"],"names":[],"mappings":";IAKS;;;MAGL;IACI;;;;;MAOJ;IACM;;;MAGN"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scriptRules.d.ts","sourceRoot":"","sources":["../../src/rules/scriptRules.js"],"names":[],"mappings":";IAGc;;;;;;;;;;MAYV"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styleRules.d.ts","sourceRoot":"","sources":["../../src/rules/styleRules.js"],"names":[],"mappings":";IAwCW;;;;;;;;;;;;;;;;MAIP;IACG;;;;;;;;;;;;;;;;MAIH;IACI;;;;;;;;;;;;;;;;MAIJ"}
|
package/dist/rules/styleRules.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
|
|
3
|
-
const mode = process.env.NODE_ENV || 'development';
|
|
4
|
-
const prod = mode === 'production';
|
|
5
|
-
const miniCssExtractLoader = () => ({
|
|
6
|
-
loader: MiniCssExtractPlugin.loader,
|
|
7
|
-
options: {
|
|
8
|
-
esModule: true,
|
|
9
|
-
modules: {
|
|
10
|
-
namedExport: true,
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
});
|
|
14
|
-
const cssLoader = (importLoaders = 1, useHash = true) => ({
|
|
15
|
-
loader: 'css-loader',
|
|
16
|
-
options: {
|
|
17
|
-
importLoaders,
|
|
18
|
-
// modules: {
|
|
19
|
-
// namedExport: true,
|
|
20
|
-
// localIdentName: '[local]' + (useHash ? '--[hash:base64:5]' : ''),
|
|
21
|
-
// exportLocalsConvention: 'camelCaseOnly',
|
|
22
|
-
// },
|
|
23
|
-
},
|
|
24
|
-
});
|
|
25
|
-
const postCSSLoader = () => ({
|
|
26
|
-
loader: 'postcss-loader',
|
|
27
|
-
options: {
|
|
28
|
-
postcssOptions: {
|
|
29
|
-
config: path.resolve(__dirname, '../config/postcss.config.js'),
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
});
|
|
33
|
-
const headCssPatterns = [/main\.css$/i, /head\.css$/i, /index\.css$/i];
|
|
34
|
-
const appStyleRules = {
|
|
35
|
-
headCss: () => ({
|
|
36
|
-
test: /\.css$/i,
|
|
37
|
-
include: headCssPatterns,
|
|
38
|
-
use: ['style-loader', cssLoader(), postCSSLoader()],
|
|
39
|
-
}),
|
|
40
|
-
css: (useHash = true) => ({
|
|
41
|
-
test: /\.css$/i,
|
|
42
|
-
exclude: [...headCssPatterns],
|
|
43
|
-
use: [cssLoader(), postCSSLoader()],
|
|
44
|
-
}),
|
|
45
|
-
sass: (useHash = true) => ({
|
|
46
|
-
test: /\.(sa|sc)ss$/i,
|
|
47
|
-
exclude: [...headCssPatterns],
|
|
48
|
-
use: [cssLoader(2), postCSSLoader(), 'sass-loader'],
|
|
49
|
-
}),
|
|
50
|
-
};
|
|
51
|
-
module.exports = {
|
|
52
|
-
appStyleRules,
|
|
53
|
-
};
|
package/public/cert/README.md
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# Development SSL Certificates
|
|
2
|
-
|
|
3
|
-
The following files are used by webpack-dev-server when `--https` is set.
|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
localhost.crt
|
|
7
|
-
localhost.key
|
|
8
|
-
```
|
|
9
|
-
|
|
10
|
-
Please follow the [Development-SSL-Certificate](https://www.notion.so/genesisglobal/Development-SSL-Certificates-30cfd42948674d0db511d04c1adb59db) guide to complete local machine setup.
|
|
11
|
-
|
|
12
|
-
### Running in HTTPS
|
|
13
|
-
|
|
14
|
-
Passing `--https` to webpack in `development` mode will enable https. Micro frontends and showcase applications will
|
|
15
|
-
likely contain npm scripts to simply this:
|
|
16
|
-
|
|
17
|
-
`"dev:webpack:https": "npm run dev:webpack -- --https"`
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
|
2
|
-
MIIEKzCCApOgAwIBAgIRAJ2DkMm20NkXjwvT0PHJCo0wDQYJKoZIhvcNAQELBQAw
|
|
3
|
-
YzEeMBwGA1UEChMVbWtjZXJ0IGRldmVsb3BtZW50IENBMRwwGgYDVQQLDBNydW5u
|
|
4
|
-
ZXJAZnYtYXozMzktNjA5MSMwIQYDVQQDDBpta2NlcnQgcnVubmVyQGZ2LWF6MzM5
|
|
5
|
-
LTYwOTAeFw0yMjEyMjIwODMxNTRaFw0yNTAzMjIwODMxNTRaMEcxJzAlBgNVBAoT
|
|
6
|
-
Hm1rY2VydCBkZXZlbG9wbWVudCBjZXJ0aWZpY2F0ZTEcMBoGA1UECwwTcnVubmVy
|
|
7
|
-
QGZ2LWF6NDE3LTI0MTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAN4X
|
|
8
|
-
hSYzKgfdIeeeMg5jpYNUJVXDjkpWI5cz73nvNztW0GAZi7vn+ts2iheP26eY4dI7
|
|
9
|
-
XaynT7JXqkqabJxFz5McgvPye9KV0foTBfTXy1Gg5AnsEgrni1zNmmJna6zB0Ybm
|
|
10
|
-
aMAeFfcOR+suhFti13R5ppstgg1MgzFWsaJYNSfziBqyj7E9CTBRWmPKIrzzdsQl
|
|
11
|
-
LBriGuLrgPesIdKfYfEgy5tHJLNgpQVwTGSzibknZdmSU+T9da7hfmiOtcKq1E3J
|
|
12
|
-
PMwIThxmh9QCDlqsKh+5qywagVllG2OaUQxJfGrq5Ihe56XzG/2ZeZuZl8H+NM3o
|
|
13
|
-
Rw2fMosW1g0pVEkazR0CAwEAAaN2MHQwDgYDVR0PAQH/BAQDAgWgMBMGA1UdJQQM
|
|
14
|
-
MAoG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zhS2pJPQ7M9LgeQ5PRDAmyIjroBvAAFpMOXB5
|
|
20
|
-
R5vf0BKWuk942Zpqi0bJkwk/m89wJWTPGqXCCMSvUSi8OVQGjgS5Tkn9QElzweoC
|
|
21
|
-
y3a23RG0j/GW7oyCKBOdspo9XmZrJY2CFdvwuI7s7FMur+plXl06Bx53ywKBgQDO
|
|
22
|
-
ehjiuRUfn9t2sSKoS7maUkUERwkQcje5cZgiFfcvVO/OBFby82Df1tzshjshRSmp
|
|
23
|
-
IgUN93iuzHOVl4+3yk+Zs+83GlpKEtYlcBoqqKXazL7sNlmu4EYt4gOv6S7J2ci0
|
|
24
|
-
YoWYecRKGCnIPB+WyKKrCvQAOdUzOsGGeAlxGVQ3WwKBgE7fJGLuraf1hHRMuPsS
|
|
25
|
-
ZGnJE93QVWOFCym34lxRWEQ3rKEXMtAhUhq/M6x5sJnv7ePTujyDoPAbAioxLS/L
|
|
26
|
-
GsrvcDc91bwNs7sDTyq//n0ehf2HJMFrbdtIPblxA26dHtX7BmW6eppDhm4OV8zO
|
|
27
|
-
1vSzX8HjCcx1AkcATKDA9J3e
|
|
28
|
-
-----END PRIVATE KEY-----
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
const { existsSync } = require('node:fs');
|
|
2
|
-
const { resolve } = require('node:path');
|
|
3
|
-
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
|
4
|
-
const portfinderSync = require('portfinder-sync');
|
|
5
|
-
const { merge } = require('webpack-merge');
|
|
6
|
-
const { getWebpackMFConfigFragment, federatedIndexExists } = require('./utils');
|
|
7
|
-
const devConfigFactory = require('./webpack.dev');
|
|
8
|
-
const prodConfig = require('./webpack.prod');
|
|
9
|
-
|
|
10
|
-
const getTemplate = () => {
|
|
11
|
-
const templateApp = resolve(process.cwd(), 'public/index.ejs');
|
|
12
|
-
const templateDefault = resolve(__dirname, '../public/index.ejs');
|
|
13
|
-
const template = existsSync(templateApp) ? templateApp : templateDefault;
|
|
14
|
-
console.log(`Using index template: ${template}`);
|
|
15
|
-
return template;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Webpack config factory
|
|
20
|
-
*
|
|
21
|
-
* @param packageJson The package.json file of the target package.
|
|
22
|
-
* @param mfOptions Module federation options to merged into the base options
|
|
23
|
-
* @param customElementTagName Tag name for insertion in the index.html file, ie. `foundation-xyz`
|
|
24
|
-
* @returns The the port number, webpack config (which can be extended further), and an isProd flag.
|
|
25
|
-
*/
|
|
26
|
-
module.exports = (packageJson, mfOptions = {}, customElementTagName) => {
|
|
27
|
-
const port = portfinderSync.getPort(packageJson.config?.PORT || process.env.PORT || 9000);
|
|
28
|
-
const isProd = process.env.NODE_ENV === 'production';
|
|
29
|
-
const envConfig = isProd ? prodConfig() : devConfigFactory(port);
|
|
30
|
-
const federatedIndexPresent = federatedIndexExists();
|
|
31
|
-
const mfConfig = federatedIndexPresent
|
|
32
|
-
? getWebpackMFConfigFragment(
|
|
33
|
-
packageJson,
|
|
34
|
-
mfOptions,
|
|
35
|
-
customElementTagName ? 'info.html' : 'index.html'
|
|
36
|
-
)
|
|
37
|
-
: {};
|
|
38
|
-
const mergedConfig = merge(envConfig, mfConfig, {
|
|
39
|
-
plugins: [
|
|
40
|
-
...(customElementTagName || !federatedIndexPresent
|
|
41
|
-
? [
|
|
42
|
-
new HtmlWebpackPlugin({
|
|
43
|
-
title: `${packageJson.description}`,
|
|
44
|
-
template: getTemplate(),
|
|
45
|
-
customElementTagName,
|
|
46
|
-
}),
|
|
47
|
-
]
|
|
48
|
-
: []),
|
|
49
|
-
],
|
|
50
|
-
});
|
|
51
|
-
return {
|
|
52
|
-
port,
|
|
53
|
-
default: mergedConfig,
|
|
54
|
-
isProd,
|
|
55
|
-
};
|
|
56
|
-
};
|
package/src/config/devServers.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const server = {
|
|
5
|
-
type: process.argv.includes('--https') ? 'https' : 'http',
|
|
6
|
-
};
|
|
7
|
-
if (server.type === 'https') {
|
|
8
|
-
try {
|
|
9
|
-
server.options = {
|
|
10
|
-
cert: fs.readFileSync(path.resolve(__dirname, '../cert/localhost.crt')),
|
|
11
|
-
key: fs.readFileSync(path.resolve(__dirname, '../cert/localhost.key')),
|
|
12
|
-
};
|
|
13
|
-
} catch (err) {
|
|
14
|
-
console.warn(
|
|
15
|
-
'You may be trying to run the webpack dev server in HTTPS mode without local certificates. Please see @genesislcap/webpack-builder README'
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
const convertWsEndpointToHTTP = (endpoint = '', socketExt) =>
|
|
20
|
-
(endpoint.startsWith('ws:')
|
|
21
|
-
? endpoint.replace('ws:', 'http:')
|
|
22
|
-
: endpoint.startsWith('wss:')
|
|
23
|
-
? endpoint.replace('wss:', 'https:')
|
|
24
|
-
: endpoint
|
|
25
|
-
).replace(`/${socketExt}`, '');
|
|
26
|
-
|
|
27
|
-
const devServers = {
|
|
28
|
-
default: (port = process.env.PORT || 9000, host = 'localhost') => {
|
|
29
|
-
const socketExt = process.env.SOCKET_EXT || 'gwf';
|
|
30
|
-
const target = convertWsEndpointToHTTP(process.env.API_HOST, socketExt);
|
|
31
|
-
return {
|
|
32
|
-
open: !process.env.CI,
|
|
33
|
-
historyApiFallback: true,
|
|
34
|
-
allowedHosts: 'all',
|
|
35
|
-
host,
|
|
36
|
-
port,
|
|
37
|
-
server,
|
|
38
|
-
client: {
|
|
39
|
-
overlay: {
|
|
40
|
-
runtimeErrors: false,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
proxy: [
|
|
44
|
-
{
|
|
45
|
-
context: [`/${socketExt}/**`, '/sso/**'],
|
|
46
|
-
target,
|
|
47
|
-
secure: false,
|
|
48
|
-
changeOrigin: true,
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
// disableHostCheck: true,
|
|
52
|
-
// sockHost: 'localhost',
|
|
53
|
-
// sockPort: '8080',
|
|
54
|
-
// https: true,
|
|
55
|
-
headers: {
|
|
56
|
-
'Access-Control-Allow-Origin': '*',
|
|
57
|
-
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, PATCH, OPTIONS',
|
|
58
|
-
'Access-Control-Allow-Headers': 'X-Requested-With, content-type, Authorization',
|
|
59
|
-
},
|
|
60
|
-
static: [
|
|
61
|
-
{
|
|
62
|
-
directory: path.resolve(process.cwd(), './public'),
|
|
63
|
-
publicPath: '/',
|
|
64
|
-
watch: true,
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
};
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
module.exports = {
|
|
72
|
-
devServers,
|
|
73
|
-
};
|