aurelia / loader-webpack

An implementation of Aurelia's loader interface to enable webpack.
MIT License
26 stars 10 forks source link

Make possible to use a different name for the app chunk #20

Closed smax48 closed 7 years ago

smax48 commented 7 years ago

I'm submitting a feature request

Please tell us about your environment:

Current behavior:

aurelia-loader-webpack always names the application chunk as 'app'. So the output file name is always 'app.bundle[.<hash>].js' I found out that the current behaviour is driven by this code in loader-webpack:

        require.ensure([], require => {
          // if failed, try resolving via the context created by the plugin //
          const result = require('aurelia-loader-context/' + path);
          return this._getActualResult(result, resolve, reject);
        }, 'app');

Expected/desired behavior:

Allow to specify a different name for the app chunk. If there is another way to achieve this, please let me know.

What is the motivation / use case for changing the behavior?

I need to use a different name for the output file that contains the app chunk. If using @easy-webpack based config (e.g. @easy-webpack/config-env-development), it is unclear how to change the output filename for the app bundle.

niieani commented 7 years ago

Thanks. I'm working on an update.

EisenbergEffect commented 7 years ago

@niieani How is this coming?

niieani commented 7 years ago

I've been working on splitting up the webpack plugin into 3-4 separate plugins / loaders, some usable even outside of Aurelia. It's a major rewrite, but it should solve 90% of all the issues currently open in the Webpack plugin and Webpack loader repos (and there are quite a few), including this one.

Since the current plugin does so much already (some developers called it "magic"), it'll also be easier to understand and configure - there'll be a single tool for a single job, instead of the current "swiss-army-knife" approach. This implementation will also make HMR and Server-Side loading (with Webpack) much easier.

I've been quite busy with other jobs lately, but that's about to change around this or next week if all goes well. I'd love some help; so @Vheissu, if you have some time and would like to help with the effort, let me know :).

EisenbergEffect commented 7 years ago

@niieani Thanks for the update. Please keep us posted. This is an important effort and your hard work is much appreciated.

Vheissu commented 7 years ago

@niieani I am definitely down to help out with this. I think it is a great idea. I am moving this weekend, but after that, I'll have a bit of time to help out.

niieani commented 7 years ago

Thanks for the offer @Vheissu. I'm still pretty busy myself, so we can dig into this when you're ready.

niieani commented 7 years ago

Fixed by https://github.com/aurelia/skeleton-navigation/pull/714