Closed bsrdjan closed 8 years ago
If I replace the .feature('framework')
with .plugin('framework')
, in the main.js, it works :)
@bsrdjan so can I close this?
Yes, of course.
I'm not much into the Aurelia source, but isn't it an anti-pattern to be using .plugin
on webpack and .feature
for every other platform supported by Aurelia? What exactly is the difference when you use .plugin
vs. .feature
?
Side note: can we have some sort of glossary about what exactly terms like "feature", "plugin", "component", "element", etc mean and how each should be used?
@jemhuntr This is an old issue with the 1.x version of the webpack plugin. 2.x is a big rewrite and this doesn't apply.
plugin
and feature
are similar but have slightly different use cases. Aurelia hub talks about them starting here. I'm quoting:
The main difference is that a "feature" is provided internally by your application, while a plugin is installed from a 3rd party source through your package manager.
Both work with the new webpack plugin:
.plugin(PLATFORM.moduleName('best-datagrid-ever'));
.feature(PLATFORM.moduleName('my-controls/index'));
One important thing to notice is that .feature
API design was not working well with webpack, so it was modified in Aurelia 1.1.0 to accept an explicit /index
that was implicit before. This is mandatory when working with webpack, as pointed out in the wiki.
BTW if you work with webpack and Aurelia the wiki is a good read.
All of this (plugin
, feature
with /index
, PLATFORM.moduleName
) works equally whether you use webpack or another build system.
Great, thanks!
I didn't know the bit about the /index being explicitly required on Webpack.
And thanks for pointing me out to the wiki :) I though the Aurelia hub was the only source of documentation in Aurelia.
I have aurelia feature residing in a folder at the same level as
/src
and try to load it using webpack but no luck yet. Here the configuration and the console errorFolder Structure
framework/index.js
main.js
webpack.config.js
The framework is bundled:
and the console error occurs: