sails-hook-shipwright 1.0.0 → 1.0.1

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 -9
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -43,6 +43,15 @@ module.exports = function defineShipwrightHook(sails) {
43
43
  config.js.entry = detectJsEntry(appPath, config.js.entry)
44
44
 
45
45
  validatePlugins({ appPath, stylesEntry: config.styles.entry, log })
46
+
47
+ // Register view locals early so other hooks/plugins can use them
48
+ sails.config.views.locals = {
49
+ ...sails.config.views.locals,
50
+ shipwright: createTagGenerators(appPath, {
51
+ jsInject: config.js.inject,
52
+ cssInject: config.styles.inject
53
+ })
54
+ }
46
55
  },
47
56
 
48
57
  /**
@@ -151,15 +160,6 @@ module.exports = function defineShipwrightHook(sails) {
151
160
  log.silly('Dropping anchor... goodbye!')
152
161
  })
153
162
  }
154
-
155
- // Register view locals (merge, don't overwrite)
156
- sails.config.views.locals = {
157
- ...sails.config.views.locals,
158
- shipwright: createTagGenerators(appPath, {
159
- jsInject: config.js.inject,
160
- cssInject: config.styles.inject
161
- })
162
- }
163
163
  } catch (error) {
164
164
  log.error('Build failed')
165
165
  log.error(error)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sails-hook-shipwright",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "The modern asset pipeline for Sails",
5
5
  "main": "index.js",
6
6
  "scripts": {