Skip to content
This repository was archived by the owner on Jun 5, 2019. It is now read-only.

Commit 2489fbc

Browse files
authored
Loosly packs image assets instead. (#9)
1 parent 1d0ae6b commit 2489fbc

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

fuse.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
const { FuseBox, CSSPlugin, Sparky, ImageBase64Plugin } = require('fuse-box')
1+
const { FuseBox, CSSPlugin, Sparky, CopyPlugin } = require('fuse-box')
22
const { spawn } = require('child_process')
33

44
const DEV_PORT = 4445
55
const OUTPUT_DIR = 'out'
6+
const ASSETS = ['*.jpg', '*.png', '*.jpeg', '*.gif', '*.svg']
67

78
// are we running in production mode?
89
const isProduction = process.env.NODE_ENV === 'production'
@@ -20,7 +21,6 @@ Sparky.task('default', ['copy-html'], () => {
2021
output: `${OUTPUT_DIR}/$name.js`,
2122
target: 'electron',
2223
cache: !isProduction,
23-
plugins: [CSSPlugin(), ImageBase64Plugin({ useDefault: true })],
2424
sourceMaps: true
2525
})
2626

@@ -38,7 +38,11 @@ Sparky.task('default', ['copy-html'], () => {
3838
}
3939

4040
// bundle the electron renderer code
41-
const rendererBundle = fuse.bundle('renderer').instructions('> [renderer/index.tsx]')
41+
const rendererBundle = fuse
42+
.bundle('renderer')
43+
.instructions('> [renderer/index.tsx]')
44+
.plugin(CSSPlugin())
45+
.plugin(CopyPlugin({ useDefault: true, files: ASSETS, dest: 'assets', resolve: 'assets/' }))
4246

4347
// and watch & hot reload unless we're bundling for production
4448
if (!isProduction) {

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/renderer/platform/components/fun-dog/fun-dog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from 'react'
22
import dogImage from './fun-dog.jpg'
33

44
const style = {
5-
width: '200',
5+
width: 200,
66
borderStyle: 'solid',
77
borderWidth: 4,
88
borderColor: 'white'

src/renderer/platform/components/logo/logo.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import * as React from 'react'
2-
// Just until this ships:
3-
// https://github.com/fuse-box/fuse-box/pull/672
4-
//
5-
// then we can drop the '* as'
6-
import * as icon from './electron-icon.svg'
2+
import icon from './electron-icon.svg'
73

84
const style = {
95
width: 80,

0 commit comments

Comments
 (0)