@marko/compiler 5.27.2 → 5.27.3

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/config.js CHANGED
@@ -148,62 +148,54 @@ var _lassoPackageRoot = require("lasso-package-root");
148
148
 
149
149
 
150
150
 
151
-
152
-
153
-
154
-
155
-
156
-
157
-
158
-
159
- var _config = _interopRequireDefault(require("./taglib/config"));let config;const globalThis = typeof window === "undefined" ? global : window;const MARKO_CONFIG_KEY = Symbol("Default Marko Compiler Config");if (globalThis[MARKO_CONFIG_KEY]) {config = globalThis[MARKO_CONFIG_KEY];} else {config = globalThis[MARKO_CONFIG_KEY] = { // The default output mode for compiled templates
160
- output: "html", // Override the runtimeid used when calling `marko/components.init` in the `hydrate` output.
161
- runtimeId: null, /**
162
- * Remove all typescript types from the output.
163
- * By default, the compiler will remove types from the output if the
164
- * `output` option is not `source` or `migrate`.
165
- */stripTypes: undefined, // Have Marko provide the final AST in the compile result.
166
- ast: false, // Set the false to have Marko not generate the final code string, useful if just reading metadata or AST.
167
- code: true, /**
168
- * Whether the version should be written to the template as a comment e.g.
169
- * // Compiled using marko@x.x.x - DO NOT EDIT
170
- */writeVersionComment: true, /**
171
- * Whether unrecognized tags should be ignored or not. This flag will
172
- * be enabled by default when compiling XML.
173
- */ignoreUnrecognizedTags: false, /**
174
- * Whether source maps should be output with the compiled templates.
175
- * When `true` a `map` property will be available on the compile result.
176
- * When `"inline"` the sourcemap will be inlined as a comment in the output code.
177
- * When `"both"` both of the above will be used.
178
- */sourceMaps: false, /**
179
- * This option inlines all of the meta data in the template.
180
- * You can also access this metadata via `compile(...).meta`.
181
- * This API is sticking around for compatibility purposes.
182
- */meta: false, /**
183
- * Allows configuring Marko to compile to different runtimes.
184
- */translator: (() => {const translatorReg = /^(@marko\/|marko-)translator-/;let translator;let pkg;try {pkg = (0, _lassoPackageRoot.getRootPackage)(process.cwd()); // eslint-disable-next-line no-empty
185
- } catch {}if (pkg) {for (const name in pkg.dependencies) {if (translatorReg.test(name)) {if (translator && translator !== name) {return;}translator = name;}}for (const name in pkg.peerDependencies) {if (translatorReg.test(name)) {if (translator && translator !== name) {return;}translator = name;}}for (const name in pkg.devDependencies) {if (translatorReg.test(name)) {if (translator && translator !== name) {return;}translator = name;}}}return translator || "@marko/translator-default";})(), /**
186
- * Use a different file system object, eg webpacks CachedInputFileSystem or lasso-caching-fs
187
- */fileSystem: _fs.default, /**
188
- * By default Marko 5 outputs esm, you can optionally specify commonjs.
189
- *
190
- * Valid options: esm | cjs
191
- */modules: "esm", /**
192
- * Enables production mode optimizations if true, or not if false.
193
- * If left as undefined checks for env === "production".
194
- */optimize: undefined, /**
195
- * This option should be set if `hydrate` output is specified.
196
- * Maps a virtual dependency to a resolved file which can be implemented
197
- * for specific bundlers.
198
- */resolveVirtualDependency: null, /**
199
- * Compiling a Marko template may require other (used) Marko templates to compile.
200
- * To prevent compiling templates more than once, most of the compilation is cached.
201
- *
202
- * The default cache strategy is to clear the cache on every macrotask.
203
- * If the default cache is overwritten it is up to the user to determine when the
204
- * cache is cleared.
205
- */cache: new Map(), /**
206
- * A regexp or function that receives an import path that matches file types known to be client side assets.
207
- */hydrateIncludeImports: /\.(css|less|s[ac]ss|styl|png|jpe?g|gif|svg|ico|webp|avif|mp4|webm|ogg|mp3|wav|flac|aac|woff2?|eot|ttf|otf)$/, /**
208
- * Set to true in order to bring in the hot module replacement runtime.
209
- */hot: false };if (process.env.MARKO_CONFIG) {Object.assign(config, JSON.parse(process.env.MARKO_CONFIG));}}var _default = config;exports.default = _default;_config.default.fs = config.fileSystem;
151
+ var _config = _interopRequireDefault(require("./taglib/config"));const config = { // The default output mode for compiled templates
152
+ output: "html", // Override the runtimeid used when calling `marko/components.init` in the `hydrate` output.
153
+ runtimeId: null, /**
154
+ * Remove all typescript types from the output.
155
+ * By default, the compiler will remove types from the output if the
156
+ * `output` option is not `source` or `migrate`.
157
+ */stripTypes: undefined, // Have Marko provide the final AST in the compile result.
158
+ ast: false, // Set the false to have Marko not generate the final code string, useful if just reading metadata or AST.
159
+ code: true, /**
160
+ * Whether the version should be written to the template as a comment e.g.
161
+ * // Compiled using marko@x.x.x - DO NOT EDIT
162
+ */writeVersionComment: true, /**
163
+ * Whether unrecognized tags should be ignored or not. This flag will
164
+ * be enabled by default when compiling XML.
165
+ */ignoreUnrecognizedTags: false, /**
166
+ * Whether source maps should be output with the compiled templates.
167
+ * When `true` a `map` property will be available on the compile result.
168
+ * When `"inline"` the sourcemap will be inlined as a comment in the output code.
169
+ * When `"both"` both of the above will be used.
170
+ */sourceMaps: false, /**
171
+ * This option inlines all of the meta data in the template.
172
+ * You can also access this metadata via `compile(...).meta`.
173
+ * This API is sticking around for compatibility purposes.
174
+ */meta: false, /**
175
+ * Allows configuring Marko to compile to different runtimes.
176
+ */translator: (() => {const translatorReg = /^(@marko\/|marko-)translator-/;let translator;let pkg;try {pkg = (0, _lassoPackageRoot.getRootPackage)(process.cwd()); // eslint-disable-next-line no-empty
177
+ } catch {}if (pkg) {for (const name in pkg.dependencies) {if (translatorReg.test(name)) {if (translator && translator !== name) {return;}translator = name;}}for (const name in pkg.peerDependencies) {if (translatorReg.test(name)) {if (translator && translator !== name) {return;}translator = name;}}for (const name in pkg.devDependencies) {if (translatorReg.test(name)) {if (translator && translator !== name) {return;}translator = name;}}}return translator || "@marko/translator-default";})(), /**
178
+ * Use a different file system object, eg webpacks CachedInputFileSystem or lasso-caching-fs
179
+ */fileSystem: _fs.default, /**
180
+ * By default Marko 5 outputs esm, you can optionally specify commonjs.
181
+ *
182
+ * Valid options: esm | cjs
183
+ */modules: "esm", /**
184
+ * Enables production mode optimizations if true, or not if false.
185
+ * If left as undefined checks for env === "production".
186
+ */optimize: undefined, /**
187
+ * This option should be set if `hydrate` output is specified.
188
+ * Maps a virtual dependency to a resolved file which can be implemented
189
+ * for specific bundlers.
190
+ */resolveVirtualDependency: null, /**
191
+ * Compiling a Marko template may require other (used) Marko templates to compile.
192
+ * To prevent compiling templates more than once, most of the compilation is cached.
193
+ *
194
+ * The default cache strategy is to clear the cache on every macrotask.
195
+ * If the default cache is overwritten it is up to the user to determine when the
196
+ * cache is cleared.
197
+ */cache: new Map(), /**
198
+ * A regexp or function that receives an import path that matches file types known to be client side assets.
199
+ */hydrateIncludeImports: /\.(css|less|s[ac]ss|styl|png|jpe?g|gif|svg|ico|webp|avif|mp4|webm|ogg|mp3|wav|flac|aac|woff2?|eot|ttf|otf)$/, /**
200
+ * Set to true in order to bring in the hot module replacement runtime.
201
+ */hot: false };if (process.env.MARKO_CONFIG) {Object.assign(config, JSON.parse(process.env.MARKO_CONFIG));}var _default = config;exports.default = _default;_config.default.fs = config.fileSystem;
package/modules.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
 
3
3
  exports.require =
4
- process.env.BUNDLE || typeof window === "object" ? undefined : require;
4
+ process.env.BUNDLE || typeof document === "object" ? undefined : require;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@marko/compiler",
3
3
  "description": "Marko template to JS compiler.",
4
- "version": "5.27.2",
4
+ "version": "5.27.3",
5
5
  "author": "Dylan Piercey <dpiercey@ebay.com>",
6
6
  "bugs": "https://github.com/marko-js/marko/issues/new?template=Bug_report.md",
7
7
  "dependencies": {
@@ -29,7 +29,7 @@
29
29
  "strip-json-comments": "^3.1.1"
30
30
  },
31
31
  "devDependencies": {
32
- "@marko/translator-default": "^5.25.2"
32
+ "@marko/translator-default": "^5.25.3"
33
33
  },
34
34
  "files": [
35
35
  "dist",