@kaliber/build 0.0.129 → 0.0.131
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/build.js +10 -1
- package/lib/serve.js +8 -2
- package/package.json +1 -1
package/lib/build.js
CHANGED
@@ -48,7 +48,14 @@ const templateRenderers = require('./getTemplateRenderers')
|
|
48
48
|
|
49
49
|
const isProduction = process.env.NODE_ENV === 'production'
|
50
50
|
|
51
|
-
const {
|
51
|
+
const {
|
52
|
+
kaliber: {
|
53
|
+
compileWithBabel: userDefinedcompileWithBabel = [],
|
54
|
+
publicPath = '/',
|
55
|
+
symlinks = true,
|
56
|
+
webpackLoaders: userDefinedWebpackLoaders = [],
|
57
|
+
} = {}
|
58
|
+
} = require('@kaliber/config')
|
52
59
|
|
53
60
|
const recognizedTemplates = Object.keys(templateRenderers)
|
54
61
|
|
@@ -272,6 +279,8 @@ module.exports = function build({ watch }) {
|
|
272
279
|
loaders: [rawLoader]
|
273
280
|
},
|
274
281
|
|
282
|
+
...userDefinedWebpackLoaders,
|
283
|
+
|
275
284
|
{
|
276
285
|
type: 'json',
|
277
286
|
test: /\.json$/,
|
package/lib/serve.js
CHANGED
@@ -32,8 +32,14 @@ const isProduction = process.env.NODE_ENV === 'production'
|
|
32
32
|
const notCached = ['html', 'txt', 'json', 'xml']
|
33
33
|
|
34
34
|
if (isProduction) app.use(morgan('combined'))
|
35
|
-
|
36
|
-
|
35
|
+
app.use(helmet(Object.assign(
|
36
|
+
{
|
37
|
+
hsts: false, // hsts-headers are sent by our loadbalancer
|
38
|
+
contentSecurityPolicy: false,
|
39
|
+
referrerPolicy: { policy: 'strict-origin-when-cross-origin' },
|
40
|
+
},
|
41
|
+
helmetOptions
|
42
|
+
)))
|
37
43
|
app.use(compression())
|
38
44
|
app.set('trust proxy', true)
|
39
45
|
serveMiddleware && app.use(...[].concat(serveMiddleware))
|
package/package.json
CHANGED