marko-real-state
Version:
Marko (v3) Real State ===========================
40 lines (29 loc) • 1.3 kB
JavaScript
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
require('marko/browser-refresh').enable();
require('lasso/browser-refresh').enable('*.marko *.css *.less');
var path = require('path');
var lasso = require('lasso');
// The following line allows us to require *.css 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', '.less');
var isProduction = (process.env.NODE_ENV === 'production');
lasso.configure({
plugins: [
'lasso-marko' // Auto compile Marko template files
],
// Directory where generated JS and CSS bundles are written
outputDir: path.join(__dirname, 'build/static'),
// URL prefix for static assets
urlPrefix: '/static',
// 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
});