@epilot360/webpack-config-epilot360 3.1.1 → 4.0.0-rc.2

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.
@@ -63,6 +63,8 @@ function webpackConfigEpilot360ReactApp(opts) {
63
63
  `${opts.orgName}-${opts.projectName}.ts`
64
64
  )
65
65
 
66
+ const useESM = Boolean(opts.useESM)
67
+
66
68
  const fileExists = (path) => {
67
69
  if (fs.existsSync(path)) return path
68
70
  if (fs.existsSync(path + 'x')) return path + 'x'
@@ -74,13 +76,16 @@ function webpackConfigEpilot360ReactApp(opts) {
74
76
  entry: fileExists(mfeEntrypoint) ?? fileExists(indexEntrypoint) ?? fileExists(legacyEntrypoint),
75
77
  output: {
76
78
  filename: `bundle.js`,
77
- libraryTarget: "system",
79
+ libraryTarget: useESM ? 'module' : 'system',
78
80
  path: path.resolve(process.cwd(), "dist"),
79
81
  uniqueName: opts.projectName,
80
82
  devtoolNamespace: `${opts.projectName}`,
81
- publicPath: "",
83
+ publicPath: useESM ? '' : 'auto',
82
84
  chunkFilename: 'chunk-[name].[chunkhash].js',
83
85
  },
86
+ experiments: {
87
+ outputModule: useESM,
88
+ },
84
89
  module: {
85
90
  rules: [
86
91
  {
@@ -162,7 +167,7 @@ function webpackConfigEpilot360ReactApp(opts) {
162
167
  analyzerMode: webpackConfigEnv.analyze ? "server" : "disabled",
163
168
  }),
164
169
  new EnvPrefixPlugin(),
165
- new SystemJSPublicPathPlugin({
170
+ useESM ? undefined : new SystemJSPublicPathPlugin({
166
171
  systemjsModuleName: `@${opts.orgName}/${opts.projectName}`,
167
172
  rootDirectoryLevel: opts.rootDirectoryLevel,
168
173
  }),
@@ -211,7 +216,6 @@ function webpackConfigEpilot360ReactApp(opts) {
211
216
  "react-dom",
212
217
  "axios",
213
218
  "lodash",
214
- "lodash/fp",
215
219
  "js-yaml",
216
220
  "handlebars",
217
221
  "moment",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epilot360/webpack-config-epilot360",
3
- "version": "3.1.1",
3
+ "version": "4.0.0-rc.2",
4
4
  "description": "A webpack config for in-browser modules used with single-spa for Epilot360",
5
5
  "main": "lib/webpack-config-epilot360-portal.js",
6
6
  "directories": {