Tag: webpack aurelia

aurelia自定义插件,使用自定义属性 – 不能find自定义属性

嗨,我已经从https://github.com/aurelia/skeleton-plugin下载了hello world aurelia skelton插件。 然后我从package.json文件中引用这个新的aurelia esnext / webpack skelton副本( https://github.com/aurelia/skeleton-navigation/tree/master/skeleton-esnext-webpack )作为我的主应用程序。 然后我可以在我的组件之一中使用插件 <require from="aurelia-skeleton-plugin/hello-world"></require> 在视图的顶部,并在视图的任何位置放置<hello-world></hello-world> 。 这工作很好。 下一步我想尝试添加一个自定义属性到我的插件。 在我的插件的src文件夹中,我添加了简单的自定义属性 export class RedSquareCustomAttribute { static inject = [Element]; constructor(element){ this.element = element; this.element.style.width = this.element.style.height = '100px'; this.element.style.backgroundColor = 'red'; } } 然后我用下面的代码在hello-world.html页面中引用它 <require from="./red-square"></require> <div red-square></div> 运行gulp生成,然后重新安装在我的主要应用程序包。 在主应用程序npm开始build立好,但浏览器给我的错误:无法find模块'./aurelia-skeleton-plugin/red-square' 我阅读了大量的文档,但没有给出这种情况的例子,任何帮助将不胜感激。

在使用Webpack构buildAurelia应用程序期间,找不到名称空间“Webpack”

我正试图用Webpackbuild立一个Aurelia应用程序,但是我总是得到这个错误: [at-loader] Checking finished with 1 errors [at-loader] ./node_modules/aurelia-loader-webpack/dist/commonjs/aurelia-loader-webpack.d.ts:31:51 TS2503: Cannot find namespace 'Webpack'. 我安装了@ types / webpack以及模块:webpack,webpack-dev-server,webpack-dev-middleware和webpack-hot-middleware。 我尝试了所有可以find的东西,但没有任何工作,我被困住了。 这是我的tsconfig: { "compilerOptions": { "target": "es5", "module": "commonjs", "emitDecoratorMetadata": true, "experimentalDecorators": true, "moduleResolution": "node", "sourceRoot": "src", "allowJs": true, "baseUrl": "src", "lib": [ "es2017", "dom" ] }, "exclude": [ "node_modules", "dist", "static" ], "typeAcquisition": { "include": [ […]