@newlogic-digital/core 2.0.0-alpha.5 → 2.0.0-alpha.6

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/index.js CHANGED
@@ -5,12 +5,14 @@ import postHtml from 'posthtml'
5
5
  import vituum from 'vituum'
6
6
  import posthtml from '@vituum/vite-plugin-posthtml'
7
7
  import latte from '@vituum/vite-plugin-latte'
8
+ import twig from '@vituum/vite-plugin-twig'
8
9
  import juice from '@vituum/vite-plugin-juice'
9
10
  import send from '@vituum/vite-plugin-send'
10
11
  import tailwindcss from '@vituum/vite-plugin-tailwindcss'
11
12
  import { getPackageInfo, merge } from 'vituum/utils/common.js'
12
- import minifier from 'html-minifier-terser'
13
- import highlight from './prism.js'
13
+ import parseMinifyHtml from './src/minify.js'
14
+ import highlight from './src/prism.js'
15
+ import twigOptions from './src/twig.js'
14
16
 
15
17
  const { name } = getPackageInfo(import.meta.url)
16
18
 
@@ -35,25 +37,6 @@ const posthtmlPrism = {
35
37
  }
36
38
  }
37
39
 
38
- const parseMinifyHtml = async (input, name) => {
39
- const minify = await minifier.minify(input, {
40
- collapseWhitespace: true,
41
- collapseInlineTagWhitespace: false,
42
- minifyCSS: true,
43
- removeAttributeQuotes: true,
44
- quoteCharacter: '\'',
45
- minifyJS: true
46
- })
47
-
48
- if (name) {
49
- return JSON.stringify({
50
- [name]: minify
51
- })
52
- } else {
53
- return JSON.stringify(minify)
54
- }
55
- }
56
-
57
40
  /**
58
41
  * @type {import('@newlogic-digital/core/types').PluginUserConfig}
59
42
  */
@@ -98,7 +81,8 @@ const defaultOptions = {
98
81
  code: 'node_modules/@newlogic-digital/core/latte/CodeFilter.php'
99
82
  },
100
83
  ignoredPaths: ['**/views/email/**/!(*.test).latte', '**/emails/!(*.test).latte']
101
- }
84
+ },
85
+ twig: twigOptions
102
86
  }
103
87
 
104
88
  /**
@@ -113,6 +97,7 @@ const plugin = (options = {}) => {
113
97
  tailwindcss(options.tailwindcss),
114
98
  posthtml(options.posthtml),
115
99
  latte(options.latte),
100
+ twig(options.twig),
116
101
  juice(options.juice),
117
102
  send(options.send),
118
103
  posthtmlPrism
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@newlogic-digital/core",
3
3
  "type": "module",
4
- "version": "2.0.0-alpha.5",
4
+ "version": "2.0.0-alpha.6",
5
5
  "main": "index.js",
6
6
  "author": "New Logic Studio s.r.o.",
7
7
  "description": "Set of tools that can be used to create modern web applications",
@@ -14,6 +14,7 @@
14
14
  "@vituum/vite-plugin-posthtml": "^1.0.0-alpha.3",
15
15
  "@vituum/vite-plugin-juice": "^1.0.0-alpha.2",
16
16
  "@vituum/vite-plugin-latte": "^1.0.0-alpha.5",
17
+ "@vituum/vite-plugin-twig": "^1.0.0-alpha.4",
17
18
  "@vituum/vite-plugin-tailwindcss": "^1.0.0-alpha.2",
18
19
  "@vituum/vite-plugin-send": "^1.0.0-alpha.2",
19
20
  "vituum": "^1.0.0-alpha.18",
@@ -33,7 +34,7 @@
33
34
  "files": [
34
35
  "latte",
35
36
  "index.js",
36
- "prism.js"
37
+ "src/prism.js"
37
38
  ],
38
39
  "engines": {
39
40
  "node": ">=16.0.0",
File without changes