sails-hook-shipwright 0.0.2 → 0.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
@@ -46,6 +46,11 @@ module.exports = function defineShipwrightHook(sails) {
46
46
  to: path.resolve(appPath, '.tmp', 'public', 'fonts'),
47
47
  noErrorOnMissing: true
48
48
  },
49
+ {
50
+ from: path.resolve(appPath, 'assets', 'dependencies'),
51
+ to: path.resolve(appPath, '.tmp', 'public', 'dependencies'),
52
+ noErrorOnMissing: true
53
+ },
49
54
  {
50
55
  context: path.resolve(appPath, 'assets'),
51
56
  from: '**/*.html',
@@ -61,6 +66,11 @@ module.exports = function defineShipwrightHook(sails) {
61
66
  chunkSplit: {
62
67
  strategy: 'all-in-one'
63
68
  }
69
+ },
70
+ server: {
71
+ port: sails.config.port,
72
+ strictPort: true,
73
+ printUrls: false
64
74
  }
65
75
  })
66
76
  const config = mergeRsbuildConfig(
@@ -73,7 +83,20 @@ module.exports = function defineShipwrightHook(sails) {
73
83
  if (process.env.NODE_ENV == 'production') {
74
84
  rsbuild.build()
75
85
  } else {
76
- rsbuild.build({ mode: 'development', watch: true })
86
+ const rsbuildDevServer = await rsbuild.createDevServer()
87
+ sails.after('hook:http:loaded', async () => {
88
+ sails.hooks.http.app.use(rsbuildDevServer.middlewares)
89
+ sails.hooks.http.server.on(
90
+ 'upgrade',
91
+ rsbuildDevServer.onHTTPUpgrade
92
+ )
93
+ })
94
+ sails.on('lifted', async () => {
95
+ await rsbuildDevServer.afterListen()
96
+ })
97
+ sails.on('lower', async () => {
98
+ await rsbuildDevServer.close()
99
+ })
77
100
  }
78
101
  } catch (error) {
79
102
  sails.error(error)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sails-hook-shipwright",
3
- "version": "0.0.2",
3
+ "version": "0.1.0",
4
4
  "description": "The modern asset pipeline for Sails",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -30,7 +30,7 @@
30
30
  "hookName": "shipwright"
31
31
  },
32
32
  "dependencies": {
33
- "@rsbuild/core": "^0.2.8"
33
+ "@rsbuild/core": "^0.6.2"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@commitlint/cli": "^18.4.3",
Binary file