@newlogic-digital/core 3.1.0-next.1 → 3.1.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/index.js +26 -12
- package/package.json +2 -2
- package/types/index.d.ts +5 -4
package/index.js
CHANGED
@@ -21,9 +21,25 @@ const defaultOptions = {
|
|
21
21
|
cert: 'localhost',
|
22
22
|
format: ['latte'],
|
23
23
|
manualChunks: {},
|
24
|
+
input: {
|
25
|
+
assets: [
|
26
|
+
'./src/styles/*.{css,pcss,scss,sass,less,styl,stylus}',
|
27
|
+
'./src/scripts/*.{js,ts,mjs}'
|
28
|
+
],
|
29
|
+
pages: [
|
30
|
+
'./src/pages/**/*.{json,latte,twig,liquid,njk,hbs,pug,html}',
|
31
|
+
'!./src/pages/**/*.{latte,twig,liquid,njk,hbs,pug,html}.json',
|
32
|
+
'!./src/pages/email/**/*'
|
33
|
+
],
|
34
|
+
emails: [
|
35
|
+
'./src/pages/email/**/*.{json,latte,twig,liquid,njk,hbs,pug,html}',
|
36
|
+
'./src/styles/emails/*.{css,pcss,scss,sass,less,styl,stylus}',
|
37
|
+
'!./src/pages/email/**/*.{latte,twig,liquid,njk,hbs,pug,html}.json'
|
38
|
+
]
|
39
|
+
},
|
24
40
|
vituum: {
|
25
|
-
|
26
|
-
|
41
|
+
imports: {
|
42
|
+
paths: ['./src/styles/*/**', '!./src/styles/emails/*', './src/scripts/*/**']
|
27
43
|
}
|
28
44
|
},
|
29
45
|
juice: {
|
@@ -86,6 +102,10 @@ const plugin = async (options = {}) => {
|
|
86
102
|
}
|
87
103
|
|
88
104
|
if (options.css.transformer === 'lightningcss') {
|
105
|
+
if (!fs.existsSync(resolve(process.cwd(), 'src/+.css'))) {
|
106
|
+
fs.writeFileSync(resolve(process.cwd(), 'src/+.css'), '@import "./styles/main.css";')
|
107
|
+
}
|
108
|
+
|
89
109
|
// @ts-ignore
|
90
110
|
const tailwindcss = (await import('@tailwindcss/vite')).default
|
91
111
|
|
@@ -109,8 +129,7 @@ const plugin = async (options = {}) => {
|
|
109
129
|
&& fs.existsSync(join(os.homedir(), `.ssh/${options.cert}-key.pem`))
|
110
130
|
|
111
131
|
let defaultInput = [
|
112
|
-
|
113
|
-
'./src/scripts/*.{js,ts,mjs}'
|
132
|
+
...(options?.input?.assets ?? [])
|
114
133
|
]
|
115
134
|
|
116
135
|
if (!options.mode) {
|
@@ -119,11 +138,8 @@ const plugin = async (options = {}) => {
|
|
119
138
|
|
120
139
|
if (options.mode === 'development') {
|
121
140
|
defaultInput = [
|
122
|
-
|
123
|
-
|
124
|
-
'!./src/pages/email/**/*',
|
125
|
-
'./src/styles/*.{css,pcss,scss,sass,less,styl,stylus}',
|
126
|
-
'./src/scripts/*.{js,ts,mjs}'
|
141
|
+
...(options?.input?.pages ?? []),
|
142
|
+
...(options?.input?.assets ?? [])
|
127
143
|
]
|
128
144
|
}
|
129
145
|
|
@@ -166,9 +182,7 @@ const plugin = async (options = {}) => {
|
|
166
182
|
userEnv.mode = 'production'
|
167
183
|
|
168
184
|
defaultInput = [
|
169
|
-
|
170
|
-
'./src/styles/emails/*.{css,pcss,scss,sass,less,styl,stylus}',
|
171
|
-
'!./src/pages/email/**/*.{latte,twig,liquid,njk,hbs,pug,html}.json'
|
185
|
+
...(options?.input?.emails ?? [])
|
172
186
|
]
|
173
187
|
|
174
188
|
userConfig.build.rollupOptions = Object.assign({
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@newlogic-digital/core",
|
3
3
|
"type": "module",
|
4
|
-
"version": "3.1.
|
4
|
+
"version": "3.1.1",
|
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",
|
@@ -13,7 +13,7 @@
|
|
13
13
|
},
|
14
14
|
"dependencies": {
|
15
15
|
"@tailwindcss/vite": "^4.1.4",
|
16
|
-
"@vituum/vite-plugin-juice": "^1.4.0
|
16
|
+
"@vituum/vite-plugin-juice": "^1.4.0",
|
17
17
|
"@vituum/vite-plugin-latte": "^1.3.0",
|
18
18
|
"@vituum/vite-plugin-posthtml": "^1.1.0",
|
19
19
|
"@vituum/vite-plugin-send": "^1.1.0",
|
package/types/index.d.ts
CHANGED
@@ -1,14 +1,15 @@
|
|
1
|
-
interface
|
2
|
-
|
3
|
-
|
1
|
+
interface Input {
|
2
|
+
assets?: string[]
|
3
|
+
pages?: string[]
|
4
|
+
emails?: string[]
|
4
5
|
}
|
5
6
|
|
6
7
|
export interface PluginUserConfig {
|
7
8
|
mode?: 'development' | 'production' | 'emails' | string
|
8
9
|
format?: string[]
|
10
|
+
input?: Input
|
9
11
|
cert?: string
|
10
12
|
manualChunks?: import('rollup').ManualChunksOption
|
11
|
-
emails?: Emails
|
12
13
|
vituum?: import('vituum').UserConfig,
|
13
14
|
css?: import('vite').CSSOptions
|
14
15
|
posthtml?: import('@vituum/vite-plugin-posthtml/types').PluginUserConfig
|