I'm submitting a bug report
Current behavior
Using aurelia.use.plugin('aurelia-dragula');
in main.js
- export function configure(aurelia) {}
will not work with the new aurelia-webpack-plugin
v2 (currently 2.0.0-rc.2).
Expected behavior Be able to load aurelia-dragula
plugin without issues under aurelia-webpack-plugin
v2.
Minimal reproduction of the problem with instructions
Please download minimal Aurelia + Webpack setup from here. Then do the following simple steps.
npm install --save aurelia-dragula
import {PLATFORM} from 'aurelia-framework';
export function configure(aurelia) {
aurelia.use
.standardConfiguration()
.plugin(PLATFORM.moduleName('aurelia-dragula')) // <--- wrapping in PLATFORM.moduleName()
.developmentLogging();
aurelia.start().then(() => aurelia.setRoot(PLATFORM.moduleName('app')));
}
Under new aurelia-webpack-plugin
it is required to wrap aurelia-dragula
by PLATFORM.moduleName()
. See more info about PLATFORM.moduleName()
.
However, the browser gives this error:
Uncaught (in promise) Error: Unable to find module with ID: aurelia-dragula/dragula-and-drop
I think internally, aurelia-dragula
should load all sub-modules using PLATFORM.moduleName()
Reason for this issue
As aurelia-webpack-plugin
is upgrading to v2 (currently 2.0.0-rc.2), aurelia-dragula
will fail to load on webpack setups.
My environment: Windows, VS Code, Webpack, Webpack Dev Server
aurelia-dragula version: 1.3.3
Note: I tried to use the following as a temporary solution in webpack.config.js
:
const AureliaWebpackPlugin = require('aurelia-webpack-plugin');
...
// under .plugins: [] section
new AureliaWebpackPlugin.ModuleDependenciesPlugin({
'aurelia-dragula': ['./dragula-and-drop'] // temp HACK
}),
But this also raised an error in the browser:
Uncaught (in promise) Error: Failed loading required CSS file: aurelia-dragula/dragula.css
@jods4 any idea how to get dragula.css
loaded by ModuleDependenciesPlugin
?