-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(bundles): improve building bundles
- Loading branch information
1 parent
ba5ec5b
commit a4db77e
Showing
27 changed files
with
996 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,5 @@ website | |
.eslintrc.js | ||
jest.config.js | ||
rollup.config.js | ||
build | ||
postcss.config.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import typescript from 'rollup-plugin-typescript2'; | ||
|
||
export default { | ||
output: { | ||
name: 'Virchual', | ||
sourcemap: true, | ||
}, | ||
plugins: [ | ||
typescript({ | ||
typescript: require('typescript'), | ||
}), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import build from './build'; | ||
import { terser } from 'rollup-plugin-terser'; | ||
import bundleSize from 'rollup-plugin-bundle-size'; | ||
|
||
export default Object.assign(build, { | ||
plugins: build.plugins.concat([ | ||
terser({ | ||
compress: { | ||
drop_console: true, | ||
keep_fargs: false, | ||
passes: 2, | ||
}, | ||
keep_fnames: false, | ||
ecma: 6, | ||
mangle: { | ||
properties: { | ||
keep_quoted: true, | ||
builtins: false, | ||
reserved: ['next', 'prev', 'register', 'Virchual'], | ||
}, | ||
toplevel: false, | ||
}, | ||
}), | ||
bundleSize(), | ||
]), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import pkg from './../package.json'; | ||
import build from './build'; | ||
|
||
export default Object.assign(build, { | ||
input: 'entry/entry-complete.ts', | ||
output: Object.assign(build.output, { | ||
file: pkg.module, | ||
format: 'es', | ||
}), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import pkg from './../package.json'; | ||
import build from './build'; | ||
|
||
export default Object.assign(build, { | ||
input: 'entry/entry-modular.ts', | ||
output: Object.assign(build.output, { | ||
file: pkg.module.split('.esm.js')[0] + '.modular.esm.js', | ||
format: 'es', | ||
}), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import pkg from './../package.json'; | ||
import build from './build'; | ||
|
||
export default Object.assign(build, { | ||
input: 'entry/entry-complete.ts', | ||
output: Object.assign(build.output, { | ||
file: pkg.browser, | ||
format: 'umd', | ||
}), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import build from './build.min'; | ||
import pkg from './../package.json'; | ||
|
||
export default Object.assign(build, { | ||
input: 'entry/entry-complete.ts', | ||
output: Object.assign(build.output, { | ||
file: pkg.browser.split('.js')[0] + '.min.js', | ||
format: 'umd', | ||
}), | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { Virchual as VirchualCore, VirchualSettings } from './../src/virchual'; | ||
import { Controls } from './../src/components/controls'; | ||
import { Lazy } from './../src/components/lazy'; | ||
|
||
export default class Virchual extends VirchualCore { | ||
constructor(public container: HTMLElement, public settings: VirchualSettings = {}) { | ||
super(container, settings); | ||
|
||
this.register(Controls, { isEnabled: true }); | ||
this.register(Lazy, { threshold: 300 }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Virchual } from './../src/virchual'; | ||
|
||
export { Controls } from './../src/components/controls'; | ||
export { Lazy } from './../src/components/lazy'; | ||
|
||
export default { | ||
Virchual, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.