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

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.
Files changed (2) hide show
  1. package/index.js +9 -10
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -68,7 +68,9 @@ const defaultOptions = {
68
68
  dir: './src/views'
69
69
  }
70
70
  },
71
- posthtml: {},
71
+ posthtml: {
72
+ root: resolve(process.cwd(), 'src')
73
+ },
72
74
  juice: {
73
75
  paths: ['src/views/email']
74
76
  },
@@ -101,7 +103,7 @@ const defaultOptions = {
101
103
 
102
104
  /**
103
105
  * @param {import('@newlogic-digital/core/types').PluginUserConfig} options
104
- * @returns import('vite').Plugin
106
+ * @returns [import('vite').Plugin]
105
107
  */
106
108
  const plugin = (options = {}) => {
107
109
  options = merge(defaultOptions, options)
@@ -116,16 +118,10 @@ const plugin = (options = {}) => {
116
118
  posthtmlPrism
117
119
  ]
118
120
 
119
- return {
121
+ return [{
120
122
  name,
121
123
  enforce: 'pre',
122
124
  config (userConfig) {
123
- if (!userConfig?.plugins) {
124
- userConfig.plugins = plugins
125
- } else if (userConfig.plugins) {
126
- userConfig.plugins = plugins.concat(...userConfig.plugins)
127
- }
128
-
129
125
  const isHttps = userConfig?.server?.https !== false &&
130
126
  fs.existsSync(join(os.homedir(), `.ssh/${options.cert}.pem`)) &&
131
127
  fs.existsSync(join(os.homedir(), `.ssh/${options.cert}-key.pem`))
@@ -134,9 +130,12 @@ const plugin = (options = {}) => {
134
130
  manifest: true,
135
131
  emptyOutDir: false,
136
132
  modulePreload: false,
133
+ assetsInlineLimit: 0,
137
134
  outDir: resolve(userConfig.root ?? process.cwd(), 'public'),
138
135
  rollupOptions: {
139
136
  input: [
137
+ './src/styles/*.{css,pcss,scss,sass,less,styl,stylus}',
138
+ './src/scripts/*.{js,ts,mjs}',
140
139
  './src/views/**/*.{json,latte,twig,liquid,njk,hbs,pug,html}',
141
140
  '!./src/views/**/*.{latte,twig,liquid,njk,hbs,pug,html}.json'
142
141
  ]
@@ -156,7 +155,7 @@ const plugin = (options = {}) => {
156
155
  : false
157
156
  }, userConfig.server ?? {})
158
157
  }
159
- }
158
+ }, ...plugins]
160
159
  }
161
160
 
162
161
  export default plugin
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.3",
4
+ "version": "2.0.0-alpha.5",
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
  "dependencies": {
14
14
  "@vituum/vite-plugin-posthtml": "^1.0.0-alpha.3",
15
15
  "@vituum/vite-plugin-juice": "^1.0.0-alpha.2",
16
- "@vituum/vite-plugin-latte": "^1.0.0-alpha.4",
16
+ "@vituum/vite-plugin-latte": "^1.0.0-alpha.5",
17
17
  "@vituum/vite-plugin-tailwindcss": "^1.0.0-alpha.2",
18
18
  "@vituum/vite-plugin-send": "^1.0.0-alpha.2",
19
19
  "vituum": "^1.0.0-alpha.18",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/node": "^20.3.1",
28
- "eslint": "^8.42.0",
28
+ "eslint": "^8.43.0",
29
29
  "eslint-config-standard": "^17.1.0",
30
30
  "typescript": "^5.1.3",
31
31
  "vite": "^4.3.9"