aurelia / aurelia/webpack-plugin
Karma test run fails unless entry: is specified in webpack config
- Dominant language
- TypeScript
- Stars
- 89
- Forks
- 33
- PR merge metrics
- No merged PRs in 30d
Description
**I'm submitting a bug report**
**Versions ->**
webpack-plugin **2.0.0-rc.5**
Windows **10**
Node **8.9.4**
NPM **5.6.0**
Webpack **3.10.0**
Karma **2.0.0**
Karma-webpack **2.0.9**
Chrome **63.0.3239.132**
Typescript **2.6.2**
**Current behavior:**
Bare bores webpack.config just for test running.
Without `plugins:[ new AureliaPlugin()]` in the webpack config tests execute as expected.
But once the preceeding plugin is defined I receive error _TypeError: request.replace is not a function_ after running `karma start`
The webpack config above does not have an `entry:` defined. (as it does not need it for Karma).
However if I add and `entry:` with any string (other than an empty string - these error still), such as the path of the only test spec file, or "ImaRandomString". Then the error goes away and tests run again.
But webpack then tries to emit a main module in addition to the spec test, and also spams the console with _ERROR in multi aurelia-webpack-plugin/runtime/empty-entry aurelia-webpack-plugin/runtime/pal-loader-entry ./test/specs.ts Module not found: Error: Can't resolve 'aurelia-webpack-plugin/runtime/empty-entry' in [my project]_
I've tried removing the `entry:` in the webpack config, and specifying some options in the AureliaPlugin ctor but all attempts still yeild the original error and no tests nun.
**Expected/desired behavior:**
It appears webpack-plugin in dependant on the `entry:` config setting in the webpack.config API and should not be ?
Contributor guide
Research direction
Reproduce the Karma run with AureliaPlugin enabled and no webpack entry, using the versions listed in the report. Inspect how the plugin handles a missing entry and verify that the fix allows tests to run without emitting an unwanted main module or reporting the empty-entry resolution error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, webpack
- Domain
- build-system, testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100