4

we started our project with ES6 javascript skeleton. we would like to extract some styles and custom attributes to a common folder so we can use these at any Aurelia module we will build in the future.

the problem is with the bundle files. we don't know how to config them to bundle external folder out of the main ES6 folder. can you please tell us what to do?

Matthew James Davis
  • 12,134
  • 7
  • 61
  • 90

1 Answers1

2

It sounds like you want to build an Aurelia plugin that you can import into any project. I would start by taking a look at the Aurelia plugin skeleton.

Once you've built your plugin with the custom styles and attributes you want, you'll want to either register it with jspm as a link, or publically through a registry such as npm or github.

Once published, you will be able to jspm install registry:my-package in any new project, and add the following line to your main.js file:

export function configure(aurelia) {
    aurelia.use
        .standardConfiguration()
        .plugin('my-package');
}

For more information on this last step, see the brilliant answer provided by Ashley Grant here.

Community
  • 1
  • 1
Matthew James Davis
  • 12,134
  • 7
  • 61
  • 90
  • Matt, I'd recommend adding language regarding a private npm feed. That is an option for publishing the plugin without it being public. Sinopia can be run locally. There are plenty of options for private npm feeds as a service as well. – Ashley Grant Jun 30 '16 at 14:13
  • Matthew James Davis, so if i understand you i need to create a plugin for every custom attribute and and the call it from main projects => main.js? And how can i install the plugin without put it on github , just from local folder... is there a way? – Eliav Maman Jun 30 '16 at 14:47
  • Matthew i added a new comment on the github thread. https://github.com/aurelia/skeleton-navigation/issues/550 – Eliav Maman Jun 30 '16 at 15:38
  • not for every custom attribute. you can make one plugin with multiple attributes. check the `jspm link` link for a local work flow – Matthew James Davis Jul 01 '16 at 03:19
  • if this answer was helpful and answered your question, please upvote and accept it :) – Matthew James Davis Jul 03 '16 at 17:43