@marko/vite 4.0.2 → 4.0.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.
Files changed (2) hide show
  1. package/dist/index.mjs +7 -1
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -658,15 +658,21 @@ function markoPlugin(opts = {}) {
658
658
  enforce: "pre",
659
659
  // Must be pre to allow us to resolve assets before vite.
660
660
  async config(config, env) {
661
+ let optimize = env.mode === "production";
662
+ if ("MARKO_DEBUG" in process.env) {
663
+ optimize = process.env.MARKO_DEBUG === "false" || process.env.MARKO_DEBUG === "0";
664
+ } else {
665
+ process.env.MARKO_DEBUG = optimize ? "false" : "true";
666
+ }
661
667
  compiler ??= await import(opts.compiler || "@marko/compiler");
662
668
  runtimeId = opts.runtimeId;
663
669
  basePathVar = opts.basePathVar;
664
670
  baseConfig = {
665
671
  cache,
672
+ optimize,
666
673
  runtimeId,
667
674
  sourceMaps: true,
668
675
  writeVersionComment: false,
669
- optimize: env.mode === "production",
670
676
  babelConfig: opts.babelConfig ? {
671
677
  ...opts.babelConfig,
672
678
  caller: opts.babelConfig.caller ? {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@marko/vite",
3
3
  "description": "A Marko plugin for Vite",
4
- "version": "4.0.2",
4
+ "version": "4.0.3",
5
5
  "author": "Dylan Piercey <dpiercey@ebay.com>",
6
6
  "bugs": "https://github.com/marko-js/vite/issues",
7
7
  "dependencies": {