@hirarijs/loader-vue 1.0.0 → 1.0.1

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/index.cjs CHANGED
@@ -46,6 +46,11 @@ const ${componentVar} = {}`;
46
46
  return { code, componentVar };
47
47
  }
48
48
  function compileVue(code, filename, ctx) {
49
+ const opts = ctx.loaderConfig.pluginOptions?.["@hirarijs/loader-vue"] || {};
50
+ const ignoreNm = opts.ignoreNodeModules !== false && opts.allowNodeModules !== true;
51
+ if (ignoreNm && filename.includes("node_modules")) {
52
+ return { code, continue: true };
53
+ }
49
54
  const { descriptor } = (0, import_compiler_sfc.parse)(code, { filename });
50
55
  const id = (0, import_crypto.createHash)("sha256").update(filename).digest("hex").slice(0, 8);
51
56
  let output;
@@ -102,7 +107,8 @@ export default ${componentVar}`;
102
107
  return {
103
108
  code: transformed.code,
104
109
  map: transformed.map,
105
- format: ctx.format
110
+ format: ctx.format,
111
+ continue: opts.continue === true
106
112
  };
107
113
  }
108
114
  var plugin = {
package/dist/index.js CHANGED
@@ -24,6 +24,11 @@ const ${componentVar} = {}`;
24
24
  return { code, componentVar };
25
25
  }
26
26
  function compileVue(code, filename, ctx) {
27
+ const opts = ctx.loaderConfig.pluginOptions?.["@hirarijs/loader-vue"] || {};
28
+ const ignoreNm = opts.ignoreNodeModules !== false && opts.allowNodeModules !== true;
29
+ if (ignoreNm && filename.includes("node_modules")) {
30
+ return { code, continue: true };
31
+ }
27
32
  const { descriptor } = parse(code, { filename });
28
33
  const id = createHash("sha256").update(filename).digest("hex").slice(0, 8);
29
34
  let output;
@@ -80,7 +85,8 @@ export default ${componentVar}`;
80
85
  return {
81
86
  code: transformed.code,
82
87
  map: transformed.map,
83
- format: ctx.format
88
+ format: ctx.format,
89
+ continue: opts.continue === true
84
90
  };
85
91
  }
86
92
  var plugin = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hirarijs/loader-vue",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Vue SFC loader plugin for HirariJS loader",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",