Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage with webpack #7

Closed
mttmccb opened this issue Nov 3, 2016 · 8 comments
Closed

Usage with webpack #7

mttmccb opened this issue Nov 3, 2016 · 8 comments
Labels

Comments

@mttmccb
Copy link
Member

mttmccb commented Nov 3, 2016

I'm running into an an issue with webpack, it doesn't look like it's importing the HTML template too as it can't find open-id-connect-user-block, any ideas how to adjust the config?

@mttmccb
Copy link
Member Author

mttmccb commented Nov 3, 2016

I've tried a few of the options in aurelia-webpack-plugin but no joy so far.

@shaunluttin
Copy link
Collaborator

shaunluttin commented Nov 3, 2016

@mttmccb I'm afraid I do not have any experience using WebPack. I do recall experiencing some frustration myself with having the HTML templates work. As a way to isolate the issue, does the demo project work for you?

git clone https://github.com/shaunluttin/aurelia-open-id-connect.git
cd aurelia-open-id-connect/demo
npm install -y
npm run demo

@shaunluttin
Copy link
Collaborator

shaunluttin commented Nov 3, 2016

@mttmccb I just read my own README and it answers your question. 😄

Set build.loader.plugs.stub = false in aurelia.json to load HTML from the package.

"loader": {
  "type": "require",
  "configTarget": "vendor-bundle.js",
  "includeBundleMetadataInConfig": "auto",
  "plugins": [
    {
      "name": "text",
      "extensions": [
        ".html",
        ".css"
      ],
      "stub":false               <----------- Set this to false.
    }
  ]
},

@mttmccb
Copy link
Member Author

mttmccb commented Nov 4, 2016

Can't get past that step, I'm getting a script error in main.js, I can't see any obvious erorrs though...

Once this issue has been resolved I'll try webpack again, hopefully early next week.

@mttmccb
Copy link
Member Author

mttmccb commented Nov 4, 2016

For the webpack project there is no aurelia.json, I suspect the changes I'm making aren't working as I don't know how to change easy-webpack to do what I want it to.

@shaunluttin
Copy link
Collaborator

shaunluttin commented Nov 4, 2016

@mttmccb Thank you for the update. It would be great to have this plugin working with all the major package managers that Aurelia supports. I appreciate your support.

@mttmccb
Copy link
Member Author

mttmccb commented Nov 11, 2016

After switching to a more standard webpack setup I was able to include the missing resources by adding this into my packages.json

  "aurelia": {
    "build": {
      "resources": [
        "aurelia-notification",
        "aurelia-i18n",
        "aurelia-animator-css",
        "aurelia-open-id-connect",
        "aurelia-open-id-connect/open-id-connect-user-block",
        "aurelia-open-id-connect/open-id-connect-role-filter"
      ]
    }
  },

@shaunluttin
Copy link
Collaborator

@mttmccb Thank you for the update. I appreciate that. That will help me to support WebPack with this plugin. I will close this issue. Thank you for your contribution, and please add other issues if you have any questions about using the plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants