Skip to content
This repository was archived by the owner on Feb 18, 2024. It is now read-only.

Should @neutrinojs/karma empty the default webpack entry point? #634

Closed
jackysee opened this issue Dec 19, 2017 · 2 comments
Closed

Should @neutrinojs/karma empty the default webpack entry point? #634

jackysee opened this issue Dec 19, 2017 · 2 comments
Labels
Milestone

Comments

@jackysee
Copy link

I have instructed @neutrinojs/karma to only load *all_test.js files

use: ['@neutrinojs/karma', {
  files: ['test/all_test.js'],
  webpackMiddleware: { noInfo: false, logLevel: trace }
}]

by using the log config above I can see that the index entry is also being compiled, which will be quite time consuming when the index entry grow large.

Currently, I just empty the entry point during test. So karma-webpack only compile necessary bundles:

    neutrino.config.when(process.env.NODE_ENV === 'test', () => {
        neutrino.config.entryPoints.clear();
    });

Should it be the default config?

@eliperelman
Copy link
Member

According to the README on webpack-karma:

// karma watches the test entry points
// (you don't need to specify the entry option)
// webpack watches dependencies

So it would seem that Karma now does this automatically, or maybe only for the test entry-points?

Thoughts @mozilla-neutrino/core-contributors? I would say this isn't a breaking change, but rather a bug.

@edmorley edmorley added this to the v9 milestone Aug 31, 2018
@edmorley
Copy link
Member

Given what the webpack-karma docs say, and that testing locally I can confirm karma doesn't use the entrypoints, I believe we should skip building them.

In fact, on master (upcoming Neutrino 9), we now omit the entrypoints (as of #852):

omit(neutrino.config.toConfig(), ['plugins', 'entry']),

(compare to Neutrino 8: https://github.com/neutrinojs/neutrino/blob/v8.3.0/packages/karma/index.js#L61)

So this will be fixed in Neutrino 9.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants