@newlogic-digital/core 2.0.0-alpha.4 → 2.0.0-alpha.6
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +13 -23
- package/package.json +3 -2
- /package/{prism.js → src/prism.js} +0 -0
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
|
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
|
*/
|
@@ -68,7 +51,9 @@ const defaultOptions = {
|
|
68
51
|
dir: './src/views'
|
69
52
|
}
|
70
53
|
},
|
71
|
-
posthtml: {
|
54
|
+
posthtml: {
|
55
|
+
root: resolve(process.cwd(), 'src')
|
56
|
+
},
|
72
57
|
juice: {
|
73
58
|
paths: ['src/views/email']
|
74
59
|
},
|
@@ -96,7 +81,8 @@ const defaultOptions = {
|
|
96
81
|
code: 'node_modules/@newlogic-digital/core/latte/CodeFilter.php'
|
97
82
|
},
|
98
83
|
ignoredPaths: ['**/views/email/**/!(*.test).latte', '**/emails/!(*.test).latte']
|
99
|
-
}
|
84
|
+
},
|
85
|
+
twig: twigOptions
|
100
86
|
}
|
101
87
|
|
102
88
|
/**
|
@@ -111,6 +97,7 @@ const plugin = (options = {}) => {
|
|
111
97
|
tailwindcss(options.tailwindcss),
|
112
98
|
posthtml(options.posthtml),
|
113
99
|
latte(options.latte),
|
100
|
+
twig(options.twig),
|
114
101
|
juice(options.juice),
|
115
102
|
send(options.send),
|
116
103
|
posthtmlPrism
|
@@ -128,9 +115,12 @@ const plugin = (options = {}) => {
|
|
128
115
|
manifest: true,
|
129
116
|
emptyOutDir: false,
|
130
117
|
modulePreload: false,
|
118
|
+
assetsInlineLimit: 0,
|
131
119
|
outDir: resolve(userConfig.root ?? process.cwd(), 'public'),
|
132
120
|
rollupOptions: {
|
133
121
|
input: [
|
122
|
+
'./src/styles/*.{css,pcss,scss,sass,less,styl,stylus}',
|
123
|
+
'./src/scripts/*.{js,ts,mjs}',
|
134
124
|
'./src/views/**/*.{json,latte,twig,liquid,njk,hbs,pug,html}',
|
135
125
|
'!./src/views/**/*.{latte,twig,liquid,njk,hbs,pug,html}.json'
|
136
126
|
]
|
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.
|
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
|