@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 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
- './src/styles/*.{css,pcss,scss,sass,less,styl,stylus}',
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
- './src/pages/**/*.{json,latte,twig,liquid,njk,hbs,pug,html}',
123
- '!./src/pages/**/*.{latte,twig,liquid,njk,hbs,pug,html}.json',
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
- './src/pages/email/**/*.{json,latte,twig,liquid,njk,hbs,pug,html}',
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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@newlogic-digital/core",
3
3
  "type": "module",
4
- "version": "3.0.1",
4
+ "version": "3.1.0",
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",
package/types/index.d.ts CHANGED
@@ -1,14 +1,15 @@
1
- interface Emails {
2
- outputDir?: string
3
- appDir?: string
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