-
Notifications
You must be signed in to change notification settings - Fork 0
/
luis.fuse.js
63 lines (58 loc) · 1.72 KB
/
luis.fuse.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
const {
FuseBox,
WebIndexPlugin,
ImageBase64Plugin,
JSONPlugin,
CSSPlugin,
CSSResourcePlugin
} = require('fuse-box');
const JsxControlsPugin = require('jsx-controls-loader').fuseBoxPlugin;
const { SnapshotPlugin } = require('luis/dist/bridges/jest/snapshot_plugin');
const GraphQLPlugin = require('fuse-box-graphql-plugin');
const fuse = FuseBox.init({
homeDir: '../../src',
target: 'browser@es6',
output: '../../.fusebox/luis/$name.js',
alias: {
data: '~/data/',
tests: '~/tests/',
client: '~/client/',
server: '~/server/',
shared: '~/shared/'
},
plugins: [
WebIndexPlugin({ template: 'index.html', target: 'index.html' }),
JsxControlsPugin,
[CSSResourcePlugin({ inline: true }), CSSPlugin()],
ImageBase64Plugin(),
JSONPlugin(),
SnapshotPlugin(),
['.graphql', GraphQLPlugin()]
],
sourceMaps: true,
shim: {
'react-router-dom': {
exports: `{
Link: props => require('react').createElement('a', { href: props.to }, props.children),
Prompt: () => require('react').createElement('div', { style: { display: 'none' } }, 'Blocker'),
withRouter: component => props => require('react').createElement(component, { ...props, location: { pathname: 'home' } })
}`
}
}
});
const historyAPIFallback = require('connect-history-api-fallback');
fuse.dev({ port: 9001 }, server => {
const app = server.httpServer.app;
app.use(historyAPIFallback());
});
fuse
.bundle('vendor')
// Watching (to add dependencies) it's damn fast anyway
// first bundle will get HMR related code injected
.instructions(` ~ luis_app.ts`); // nothing has changed here
fuse
.bundle('app')
.instructions(` !> [luis_app.ts]`)
.hmr()
.watch();
fuse.run();