-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.js
76 lines (65 loc) · 2.35 KB
/
configure.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
require('marko/node-require').install();
// If the process was started using browser-refresh then enable hot reloading for certain types
// of files to short-circuit a full process restart.
// You *should* use browser-refresh in development: https://www.npmjs.com/package/browser-refresh
// Developers can enable browser-refresh when starting server > browser-refresh app.js
require('marko/browser-refresh').enable();
require('lasso/browser-refresh').enable('*.marko *.css *.less *.styl *.scss *.sass *.png *.jpeg *.jpg *.gif *.webp *.svg');
//var path = require('path');
//var lasso = require('lasso');
// The following line allows us to require *.css, *.scss, *.styl and *.less files
// in code that runs on the server, but nothing actually happens on the server
require('lasso/node-require-no-op').enable('.css', '.scss', '.sass', '.less', '.styl');
var isProduction = (process.env.NODE_ENV === 'production');
require('lasso').configure({
plugins: [
'lasso-marko', // Auto compile Marko template files
'lasso-sass',
{
'plugin': 'lasso-autoprefixer',
'config': {
'browsers': [
'last 2 versions',
'> 1%'
]
}
},
'lasso-less'
],
// Directory where generated JS and CSS bundles are written
'outputDir': 'public/dist',
// URL prefix for static assets
urlPrefix: '/dist',
// Only bundle up JS and CSS files in production builds
bundlingEnabled: isProduction,
// Only minify JS and CSS files in production builds
minify: isProduction,
// Only fingerprint JS and CSS files in production builds
fingerprintsEnabled: isProduction,
bundles: [ // Create separate JS bundles. Only needed to guage the size of each library.
// {
// name: 'jquery',
// dependencies: [
// 'require: jquery' // Put all the jQuery code into this bundle
// ]
// },
{
name: 'marko',
dependencies: [
'require: marko'
]
},
{
name: 'marko-widgets',
dependencies: [
'require: marko-widgets'
]
},
{
name: 'events',
dependencies: [
'require: events'
]
}
]
});