-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfractal.config.js
44 lines (39 loc) · 1.37 KB
/
fractal.config.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
const fractal = require('@frctl/fractal').create();
const path = require('path');
const { config } = require('./package.json');
const instance = fractal.components.engine();
fractal.components.set('path', config.paths.source.patterns);
fractal.web.set('static.path', `${__dirname}${config.paths.source.static}`);
// fractal.web.set('builder.dest', config.paths.export.root);
fractal.web.set('server.sync', true);
fractal.set('project.isDevelop', 'true');
instance.handlebars.registerHelper(
'static',
(file) => `//localhost:${config.paths.source.vitePort}/${file}`,
);
instance.handlebars.registerHelper(
'vite',
() => `//localhost:${config.paths.source.vitePort}/`,
);
/*
if (process.env.ENV === 'development') {
instance.handlebars.registerHelper(
'static',
(file) => `//localhost:${config.paths.source.vitePort}/${file}`,
);
fractal.set('project.isDevelop', 'true');
fractal.web.set('server.syncOptions', {
// cors: true,
open: true,
notify: true,
watchOptions: {
ignored: [path.resolve('**\/*.css'), path.resolve('**\/*.scss')],
},
});
} else {
const manifest = require(`./${config.paths.dist.root}manifest.json`);
instance.handlebars.registerHelper('manifest', (key, subkey) => `/${manifest[key][subkey]}`);
instance.handlebars.registerHelper('static', (file) => `${config.paths.dist.root}/${file}`);
}
*/
module.exports = fractal;