-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
How to config HtmlWebpackPlugin #1192
Comments
Hey @bigopon , thanks for opening this issue! We'll probably need to add an Aurelia template, as it seems to be doing some low-level stuff. Cc @CompuIves . If you want to fiddle around (and maybe add an Aurelia template), you can find the existing templates' configuration here: https://github.com/CompuIves/codesandbox-client/tree/master/packages/common/templates . You can also take a look at #709 , which is a PR adding templates for CxJS and Dojo. |
@lbogdan We are thrilled about the potential of getting Aurelia on CodeSandbox. Once that's setup, we're going to start embedding it directly within our documentation and hopefully our home page as well. We'll also be blogging about it (and using it in our official blog too). It will be great for our community. In light of that, would you be able to assist us a bit more directly in getting the template built out? We've been looking at a few examples but we see a good amount of variation and we aren't sure what the various APIs and settings are doing. @bigopon is the team member that's investigating it on our side. |
@EisenbergEffect Sure, I'll try! |
@lbogdan Thanks for helping!. I have 2 examples atm:
I can also setup 2 repos for simple / full for JS. Are they good as examples? |
So it looks like Aurelia's underlying development infrastructure is complex enough to require using a server / container template. I've taken your first repo and adapted it to work inside a container sandbox (you can take a look at what I did to achieve that, it's quite simple). This is the route we went with all the other complex frameworks out there (gatsby, next, nuxt). To make an informed decision, the current pros/cons with this approach are:
Please let me know what your thoughts are about this. |
@lbogdan I feel it would require a much simpler version and preferably stay as plain as possible. For example, Html webpack plugin can be removed, if we know how to point const { AureliaPlugin } = require('aurelia-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const path = require('path');
module.exports = {
resolve: {
extensions: [".ts", ".js"],
modules: ["src", "node_modules"],
},
entry: {
app: ["aurelia-bootstrapper"],
},
module: {
rules: [
{ test: /\.ts$/, use: 'ts-loader' },
{ test: /\.html$/, loader: 'html-loader' }
]
},
plugins: [
new AureliaPlugin(),
// this can be removed if we can point to `dist/app.bundle.js` and run easily
new HtmlWebpackPlugin({
template: 'index.ejs'
})
]
} For your container example with the ability to have arbitrary webpack configuration, that would be the way to go for members who want to do everything in codesandbox. We probably want to have that too! But our main focus is to have first integration step done before we explore that option. cc @EisenbergEffect |
The thing is that the client bundler is not webpack, but "webpack like", so it doesn't support webpack plugins out of the box (we would have to adapt |
@lbogdan Thanks for that. @lbogdan @CompuIves For the context, I'm not sure if it will help clarify anything, current I'm using 2 base projects: TS https://codesandbox.io/s/1zk698l74 |
@lbogdan |
Closing this, as (hopefully) it was solved with the adding of the Aurelia template. Please reopen if that's not the case and I'm in the wrong here. |
❔ Question
Link to sandbox: (https://codesandbox.io/s/p7km1z3jlx)
Your Environment
I'm having difficulty making the example in the link above work. The way a normal Aurelia app works is an entry script pointing to module
aurelia-bootstrapper
, which does all the bootstrapping, and then find element with attributeaurelia-app
to find what module it should use for application startup (which in the link above, it'smain
). I'm not sure what I need to do to have this setup done in Codesandbox way. Could I have some hints for this? I was looking at other framework setup but none seems to useHtmlWebpackPlugin
, and it's pretty hard to find where the setup is for Angular, Vue, React, Preact, SvelteThe text was updated successfully, but these errors were encountered: