Skip to content

Commit

Permalink
chore: tweak build/sample so build works again
Browse files Browse the repository at this point in the history
  • Loading branch information
vegarringdal committed Apr 13, 2020
1 parent e871d87 commit e2bfa65
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
21 changes: 12 additions & 9 deletions fuse.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const { fusebox, sparky } = require('fuse-box');
const { pluginTypeChecker } = require('fuse-box-typechecker');

Expand All @@ -12,7 +13,7 @@ class Context {
publicPath: './'
},
cache: {
root: '.cache',
root: '.cache/sample',
enabled: true
},
watcher: {
Expand All @@ -30,11 +31,11 @@ class Context {
});
}
}
const { task } = sparky(Context);
const { task, rm } = sparky(Context);

task('default', async ctx => {
task('default', async (ctx) => {
const fuse = ctx.getConfig();
await fuse.runDev();
await fuse.runDev({ bundles: { distRoot: `.cache/dist`, app: 'app.js' } });
});

const build = (target) => {
Expand All @@ -47,27 +48,29 @@ const build = (target) => {
module: target,
lib: ['es2017', 'dom'],
emitDecoratorMetadata: true,
skipLibCheck: true,
sourceMap: true,
declaration: true,
importHelpers: true,
experimentalDecorators: true
},
exclude: ['dist', 'node_modules', 'src/sample']
exclude: ['dist', 'node_modules', 'src/sample', 'src/__tests__']
},
basePath: `./`,
name: `Building ${target}`
});

checker.printSettings();
let result = checker.inspectOnly();
const result = checker.inspectOnly();
checker.printOnly(result);

console.log(` -> Emitting js`);
result.oldProgram.emit();
};

task('build', async ctx => {
['CommonJS', 'AMD', 'System', 'UMD', 'ES6', 'ES2015', 'ESNext'].forEach(target => {
task('build', async () => {
await rm('./dist');
['CommonJS', 'AMD', 'System', 'UMD', 'ES6', 'ES2015', 'ESNext'].forEach((target) => {
build(target);
});
});
2 changes: 1 addition & 1 deletion rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default [
{
input: 'dist/ES6/index.js',
output: {
name: 'customElementsHmrPolyfill',
name: 'customElementsHmrPolyfill',
file: './dist/custom-elements-hmr-pollyfill.umd.js',
format: 'umd',
sourcemap: true
Expand Down

0 comments on commit e2bfa65

Please sign in to comment.