Skip to content

Commit

Permalink
feat(bundle): minify built assets. core bundle is 827 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Apr 10, 2022
1 parent 3a50601 commit 27452a4
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,19 @@ This requires a stateful helper by globally available to your app. Helpers are t
stateless, so this would go against most guidance on helpers.
## Debugging and working with Resources
_More information contained in the `docs` folder_.
High-fidelity sourcemaps are provided in the original typescript.
However, you must be using embroider to take advantage of them.
## Related addons
List of addons that use and wrap `ember-resources` to provide more specific functionality:
- [ember-data-resources](https://github.com/NullVoxPopuli/ember-data-resources) - resources for reactive data fetching with ember-data
- [ember-array-map-resource](https://github.com/NullVoxPopuli/ember-array-map-resource) - provides a useArrayMap function which returns a resource that reactively maps data per-element, so that when the overall collection is dirtied, only the changed/new/removed elements affect the mapped collection
- [ember-use-sound](https://github.com/chrismllr/ember-use-sound) - a resource for interacting with audio files
## Contributing
Expand Down
7 changes: 7 additions & 0 deletions ember-resources/config/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import ts from 'rollup-plugin-ts';
import { Addon } from '@embroider/addon-dev/rollup';
import { defineConfig } from 'rollup';
import { summary } from '@nullvoxpopuli/rollup-bundle-summary';
import { terser } from "rollup-plugin-terser";

const addon = new Addon({
srcDir: 'src',
Expand Down Expand Up @@ -68,8 +69,14 @@ export default defineConfig({
// to leave alone and keep in the published output.
// addon.keepAssets(['**/*.css']),

// Start with a clean output directory before building
addon.clean(),

// Minify!
// This encourages addon devs to worry less about bundle size
// of this library when evaluating.
terser(),

// // output stats to the CLI during build
summary(),
],
Expand Down
1 change: 1 addition & 0 deletions ember-resources/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@
"eslint-plugin-simple-import-sort": "^7.0.0",
"npm-run-all": "4.1.5",
"rollup": "2.70.1",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-ts": "^2.0.5",
"semantic-release": "^19.0.2",
"tslib": "^2.3.1",
Expand Down
23 changes: 23 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 27452a4

Please sign in to comment.