@newlogic-digital/core 3.0.1 → 3.1.0
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 +20 -10
- package/package.json +1 -1
- package/types/index.d.ts +5 -4
package/index.js
CHANGED
@@ -21,6 +21,22 @@ 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
41
|
imports: {
|
26
42
|
paths: ['./src/styles/*/**', '!./src/styles/emails/*', './src/scripts/*/**']
|
@@ -109,8 +125,7 @@ const plugin = async (options = {}) => {
|
|
109
125
|
&& fs.existsSync(join(os.homedir(), `.ssh/${options.cert}-key.pem`))
|
110
126
|
|
111
127
|
let defaultInput = [
|
112
|
-
|
113
|
-
'./src/scripts/*.{js,ts,mjs}'
|
128
|
+
...(options?.input?.assets ?? [])
|
114
129
|
]
|
115
130
|
|
116
131
|
if (!options.mode) {
|
@@ -119,11 +134,8 @@ const plugin = async (options = {}) => {
|
|
119
134
|
|
120
135
|
if (options.mode === 'development') {
|
121
136
|
defaultInput = [
|
122
|
-
|
123
|
-
|
124
|
-
'!./src/pages/email/**/*',
|
125
|
-
'./src/styles/*.{css,pcss,scss,sass,less,styl,stylus}',
|
126
|
-
'./src/scripts/*.{js,ts,mjs}'
|
137
|
+
...(options?.input?.pages ?? []),
|
138
|
+
...(options?.input?.assets ?? [])
|
127
139
|
]
|
128
140
|
}
|
129
141
|
|
@@ -166,9 +178,7 @@ const plugin = async (options = {}) => {
|
|
166
178
|
userEnv.mode = 'production'
|
167
179
|
|
168
180
|
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'
|
181
|
+
...(options?.input?.emails ?? [])
|
172
182
|
]
|
173
183
|
|
174
184
|
userConfig.build.rollupOptions = Object.assign({
|
package/package.json
CHANGED
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
|