sails-hook-shipwright 0.2.0 → 0.2.2

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
@@ -19,28 +19,28 @@ module.exports = function defineShipwrightHook(sails) {
19
19
  const files = data.allFiles
20
20
  return files
21
21
  }
22
- function generateScripts() {
23
- const manifestFiles = getManifestFiles()
24
- let scripts = []
25
- manifestFiles.forEach((file) => {
26
- if (file.endsWith('.js')) {
27
- scripts.push(`<script type="text/javascript" src="${file}"></script>`)
28
- }
29
- })
30
- return scripts.join('\n')
31
- }
32
22
 
33
- function generateStyles() {
34
- const manifestFiles = getManifestFiles()
35
- let styles = []
36
- manifestFiles.forEach((file) => {
37
- if (file.endsWith('.css')) {
38
- styles.push(`<link rel="stylesheet" href="${file}">`)
39
- }
40
- })
41
- return styles.join('\n')
42
- }
43
23
  return {
24
+ generateScripts: function generateScripts() {
25
+ const manifestFiles = getManifestFiles()
26
+ let scripts = []
27
+ manifestFiles.forEach((file) => {
28
+ if (file.endsWith('.js')) {
29
+ scripts.push(`<script type="text/javascript" src="${file}"></script>`)
30
+ }
31
+ })
32
+ return scripts.join('\n')
33
+ },
34
+ generateStyles: function generateStyles() {
35
+ const manifestFiles = getManifestFiles()
36
+ let styles = []
37
+ manifestFiles.forEach((file) => {
38
+ if (file.endsWith('.css')) {
39
+ styles.push(`<link rel="stylesheet" href="${file}">`)
40
+ }
41
+ })
42
+ return styles.join('\n')
43
+ },
44
44
  defaults: {
45
45
  shipwright: {
46
46
  build: {}
@@ -50,6 +50,7 @@ module.exports = function defineShipwrightHook(sails) {
50
50
  * Runs when this Sails app loads/lifts.
51
51
  */
52
52
  initialize: async function () {
53
+ const hook = this
53
54
  const appPath = sails.config.appPath
54
55
  const defaultConfigs = defineConfig({
55
56
  source: {
@@ -139,7 +140,10 @@ module.exports = function defineShipwrightHook(sails) {
139
140
  sails.after('lifted', () => {})
140
141
  }
141
142
  sails.config.views.locals = {
142
- shipwright: { scripts: generateScripts, styles: generateStyles }
143
+ shipwright: {
144
+ scripts: hook.generateScripts,
145
+ styles: hook.generateStyles
146
+ }
143
147
  }
144
148
  } catch (error) {
145
149
  sails.log.error(error)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sails-hook-shipwright",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
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.7.1"
33
+ "@rsbuild/core": "^0.7.10"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@commitlint/cli": "^18.4.3",
Binary file
Binary file