hof 24.4.0 → 24.5.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/README.md CHANGED
@@ -139,6 +139,16 @@ Each task (except Vite) has a common configuration format with the following opt
139
139
  - `match` - defines the pattern for files to watch to trigger a rebuild of this task
140
140
  - `restart` - defines if this task should result in a server restart
141
141
 
142
+ For Vite, the following configuration can be specified:
143
+ - `outDir` - Specifies the output directory (relative to project root). Only changes only the build output location, does not change runtime static mounting.
144
+ Example from hof settings:
145
+ ```js
146
+ "js": {
147
+ "outDir": './dist/public'
148
+ }
149
+ ```
150
+
151
+
142
152
  Additionally the server instance created by `watch` can be configured by setting `server` config. Available options are:
143
153
 
144
154
  - `cmd` - defines the command used to start the server
@@ -7,18 +7,23 @@ const hofDefaults = require('../../../config/hof-defaults');
7
7
 
8
8
  module.exports = config => {
9
9
  process.env.NODE_ENV = hofDefaults.env;
10
+ const publicDirectory = path.resolve(process.cwd(), config.js.outDir || 'public');
10
11
 
11
12
  if(!config.production) {
12
13
  return vite.build({
13
14
  configFile: viteConfig,
14
15
  mode: 'development',
15
16
  build: {
16
- sourcemap: config.js.sourceMaps
17
+ sourcemap: config.js.sourceMaps,
18
+ outDir: publicDirectory
17
19
  }
18
20
  });
19
21
  }
20
22
  return vite.build({
21
- configFile: viteConfig
23
+ configFile: viteConfig,
24
+ build: {
25
+ outDir: publicDirectory
26
+ }
22
27
  });
23
28
  };
24
29
  module.exports.task = 'vite';
@@ -7,7 +7,6 @@ import fs from 'fs';
7
7
  import { nodeResolve } from '@rollup/plugin-node-resolve';
8
8
  import commonjs from '@rollup/plugin-commonjs';
9
9
 
10
- const publicDirectory = resolve(process.cwd(), 'public');
11
10
  const entryFile = (() => {
12
11
  const src = resolve(process.cwd(), 'assets/js/index.js');
13
12
  if (fs.existsSync(src)) return src;
@@ -49,7 +48,6 @@ export default defineConfig({
49
48
  base: '/assets/',
50
49
  publicDir: 'static', // static files copied as-is
51
50
  build: {
52
- outDir: publicDirectory,
53
51
  emptyOutDir: false,
54
52
  sourcemap: false,
55
53
  rollupOptions: {
@@ -15,7 +15,8 @@ module.exports = {
15
15
  sourceMaps: false
16
16
  },
17
17
  js: {
18
- sourceMaps: false
18
+ sourceMaps: false,
19
+ outDir: 'public'
19
20
  },
20
21
  translate: {
21
22
  src: 'apps/**/translations/src',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hof",
3
3
  "description": "A bootstrap for HOF projects",
4
- "version": "24.4.0",
4
+ "version": "24.5.0",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
7
7
  "author": "HomeOffice",