Skip to content

Commit

Permalink
Update sample-rollup.config.js
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed Nov 1, 2021
1 parent 44ae45e commit 2ce525e
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/addon-dev/sample-rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
import babel from '@rollup/plugin-babel';
import { babel } from '@rollup/plugin-babel';
import { nodeResolve } from '@rollup/plugin-node-resolve';

import { Addon } from '@embroider/addon-dev/rollup';

import packageJson from './package.json';

const addon = new Addon({
srcDir: 'src',
destDir: 'dist',
});

const extensions = ['.js', '.ts'];

export default {
// This tells rollup to follow the node-resolution algorithm for finding
// dependencies / and files within those dependencies
nodeResolve({ extensions }),

// This provides defaults that work well alongside `publicEntrypoints` below.
// You can augment this if you need to.
output: addon.output(),

// This prevents peerDependencies from being included in your bundle
external: Object.keys(packageJson['peerDependencies']),

plugins: [
// These are the modules that users should be able to import from your
Expand All @@ -26,6 +39,7 @@ export default {
// template colocation.
babel({
plugins: ['@embroider/addon-dev/template-colocation-plugin'],
extensions,
}),

// Ensure that standalone .hbs files are properly integrated as Javascript.
Expand Down

0 comments on commit 2ce525e

Please sign in to comment.