Skip to content

Commit ac5f6fc

Browse files
fix: attempt module bundling
1 parent 2a73eb8 commit ac5f6fc

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

fuse.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ task('cp.jest', () => {
4646
return src('jest/**', { base: 'src/templates/unit-tests' }).dest('.build/')
4747
})
4848

49-
task('bundle', ['cp.jest'], () => {
49+
task('bundle', ['cp.jest', 'ng.svg'], () => {
5050
bundle.instructions('> [src/index.ts]')
5151
!isProdBuild &&
5252
bundle.watch(`src/**`).completed(fp => shabang(fp.bundle, absOutputPath))
@@ -56,3 +56,22 @@ task('bundle', ['cp.jest'], () => {
5656
bundle && shabang(bundle, absOutputPath)
5757
})
5858
})
59+
60+
task('ng.svg', () => {
61+
const config = FuseBox.init({
62+
homeDir,
63+
output: `${outputDir}/modules/svg/$name.js`,
64+
globals: {
65+
default: '*'
66+
},
67+
package: {
68+
name: 'default',
69+
main: outputPath
70+
}
71+
})
72+
src('**', { base: 'src/modules/svg' })
73+
.dest('.build/modules/svg')
74+
.exec()
75+
config.bundle('index').instructions('> [src/modules/svg/index.ts]')
76+
config.run()
77+
})

src/modules/svg/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { TestingThisOut } from './test'

src/modules/svg/test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// tslint:disable-next-line:no-class
2+
export class TestingThisOut {}

0 commit comments

Comments
 (0)