@ditojs/build 1.30.0 → 2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditojs/build",
3
- "version": "1.30.0",
3
+ "version": "2.1.0",
4
4
  "type": "module",
5
5
  "repository": "https://github.com/ditojs/dito/tree/master/packages/build",
6
6
  "author": "Jürg Lehni <juerg@scratchdisk.com> (http://scratchdisk.com)",
@@ -30,6 +30,6 @@
30
30
  "postcss": "^8.4.21",
31
31
  "postcss-inset": "^1.0.0"
32
32
  },
33
- "gitHead": "5d09dc24ecb77b511f3c25643275ea1b9514fb52",
33
+ "gitHead": "5c5048b661395268e720b9ec402d4301bb4a34aa",
34
34
  "readme": "# Dito.js Build Helper Functions\n\nDito.js is a declarative and modern web framework with a focus on API driven\ndevelopment, based on Koa.js, Objection.js and Vue.js\n\nReleased in 2018 under the MIT license, with support by https://lineto.com/\n"
35
35
  }
package/src/rollup.js CHANGED
@@ -29,8 +29,7 @@ export function getRollupExternalsFromDependencies({
29
29
  addDependencies(packageJson.dependencies)
30
30
  addDependencies(packageJson.peerDependencies)
31
31
  addDependencies(packageJson.devDependencies)
32
- } catch (err) {
33
- }
32
+ } catch (err) {}
34
33
  }
35
34
 
36
35
  // Start with root to read from './package.json.js' and take it from there.
package/src/vite.js CHANGED
@@ -1,11 +1,10 @@
1
- import { defineConfig as defineViteConfig } from 'vite'
2
- import { createVuePlugin } from 'vite-plugin-vue2'
1
+ import { defineConfig } from 'vite'
2
+ import createVuePlugin from '@vitejs/plugin-vue'
3
3
  import { getPostCssConfig } from './postcss.js'
4
4
  import { getRollupExternalsFromDependencies } from './rollup.js'
5
5
 
6
6
  export function getViteConfig({
7
7
  name,
8
- defineConfig = defineViteConfig,
9
8
  css = false,
10
9
  vue = false,
11
10
  build = true,
@@ -17,10 +16,13 @@ export function getViteConfig({
17
16
  } = {},
18
17
  ...rest
19
18
  } = {}) {
20
- const externals = build && getRollupExternalsFromDependencies({
21
- include,
22
- exclude
23
- })
19
+ const externals = (
20
+ build &&
21
+ getRollupExternalsFromDependencies({
22
+ include,
23
+ exclude
24
+ })
25
+ )
24
26
  return defineConfig({
25
27
  plugins: vue
26
28
  ? [createVuePlugin()]
@@ -30,23 +32,23 @@ export function getViteConfig({
30
32
  : null,
31
33
  build: build
32
34
  ? {
33
- minify,
34
- sourcemap,
35
- cssCodeSplit: false,
36
- lib: {
37
- name,
38
- format: ['es', 'umd'],
39
- entry: './src/index.js',
40
- fileName: format => `${name}.${format}.js`
41
- },
42
- rollupOptions: {
43
- external: id => !!externals[id],
44
- output: {
45
- manualChunks: undefined,
46
- globals: externals
35
+ minify,
36
+ sourcemap,
37
+ cssCodeSplit: false,
38
+ lib: {
39
+ name,
40
+ format: ['es', 'umd'],
41
+ entry: './src/index.js',
42
+ fileName: format => `${name}.${format}.js`
43
+ },
44
+ rollupOptions: {
45
+ external: id => !!externals[id],
46
+ output: {
47
+ manualChunks: undefined,
48
+ globals: externals
49
+ }
47
50
  }
48
51
  }
49
- }
50
52
  : null,
51
53
  css: css
52
54
  ? { postcss: getPostCssConfig() }