@linktr.ee/create-link-app 0.3.0-next.34 → 0.3.0-next.35

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.
@@ -59,17 +59,7 @@ async function default_1(env, options) {
59
59
  const useAppEntry = hasEntrypoint(appDir, 'App.tsx');
60
60
  const useSheetEntry = hasEntrypoint(appDir, 'Sheet.tsx');
61
61
  const useEditorEntry = hasEntrypoint(appDir, 'Editor.tsx');
62
- const exposedEntryPoints = {
63
- // Default entry points
64
- ['./App']: useAppEntry ? path_1.default.resolve(appDir, 'src/App') : path_1.default.resolve(appDir, 'src'),
65
- ['./validate']: toVirtualModule((await (0, compile_1.default)())),
66
- };
67
- if (useEditorEntry) {
68
- exposedEntryPoints['./Editor'] = path_1.default.resolve(appDir, 'src/Editor');
69
- }
70
- if (useSheetEntry) {
71
- exposedEntryPoints['./Sheet'] = path_1.default.resolve(appDir, 'src/Sheet');
72
- }
62
+ const appEntry = useAppEntry ? path_1.default.resolve(appDir, 'src/App') : path_1.default.resolve(appDir, 'src');
73
63
  const manifestJson = JSON.parse(fs_1.default.readFileSync(path_1.default.resolve(appDir, 'manifest.json'), 'utf8'));
74
64
  const linkTypeName = manifestJson.name.replace(/[^A-Za-z0-9 ]/g, '');
75
65
  const linkTypeSlug = (0, slugify_1.default)(linkTypeName, { lower: true });
@@ -126,7 +116,7 @@ async function default_1(env, options) {
126
116
  // TODO: The behaviour here with module resolution is confusing, can we make it more explicit?
127
117
  modules: [path_1.default.resolve(appDir, 'node_modules'), 'node_modules'],
128
118
  alias: {
129
- '@linktr.ee/extension': exposedEntryPoints['./App'],
119
+ '@linktr.ee/extension': appEntry,
130
120
  },
131
121
  },
132
122
  plugins: [
@@ -149,6 +139,17 @@ async function default_1(env, options) {
149
139
  config.plugins.push(new mini_css_extract_plugin_1.default());
150
140
  }
151
141
  if (env === 'production') {
142
+ const exposedEntryPoints = {
143
+ // Default entry points
144
+ ['./App']: appEntry,
145
+ ['./validate']: toVirtualModule((await (0, compile_1.default)())),
146
+ };
147
+ if (useEditorEntry) {
148
+ exposedEntryPoints['./Editor'] = path_1.default.resolve(appDir, 'src/Editor');
149
+ }
150
+ if (useSheetEntry) {
151
+ exposedEntryPoints['./Sheet'] = path_1.default.resolve(appDir, 'src/Sheet');
152
+ }
152
153
  // TODO: Figure out how to manage externals with Module Federation
153
154
  // Possibly make the index.html a host app, via separate webpack config
154
155
  // config.externals = {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.3.0-next.34",
2
+ "version": "0.3.0-next.35",
3
3
  "commands": {
4
4
  "build": {
5
5
  "id": "build",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linktr.ee/create-link-app",
3
- "version": "0.3.0-next.34",
3
+ "version": "0.3.0-next.35",
4
4
  "description": "Create a Link App on Linktr.ee.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Linktree",