Comments (10)
In case of tests this 892 modules of which 295 are transpiled with babel.
from karma-webpack.
Do you use the alternative useage?
from karma-webpack.
Yes. I think the test bundle takes 30-40 seconds to compile if I use babel. And 10 seconds without babel which is acceptable. Maybe this project is just too large, or maybe I shouldn't be always running all tests - but the latter is not easy with karma.
from karma-webpack.
I'm thinking about building another karma-webpack like plugin which allows a --grep
arg to filter which test files get bundled. Is that of interest to anyone? :-"
from karma-webpack.
I think I managed to add some simple grepping via ContextReplacementPlugin
// my test-main.js
var testsContext = require.context("../..", true, /_test$/);
testsContext.keys().forEach(testsContext);
// karma.config.js
...
if (argv.grep) {
webpackConfig.plugins = _.union(webpackConfig.plugins, [
new webpack.ContextReplacementPlugin(new RegExp('../..'), function (result) {
result.regExp = new RegExp('.*' + argv.grep + '.*_test$');
})
]);
}
...
This allows me to run karma start --grep foo
to filter some subset of tests to build with webpack, leaving full test runs to CI.
from karma-webpack.
I just gave this a try and my test time increased by 2 seconds... Very odd.
from karma-webpack.
Perhaps that's the case for small sets of tests. For me, when I grep a small subset of tests, the time decreases from 2minutes to 15 seconds.
from karma-webpack.
I've just blogged about the --grep
trick https://medium.com/@kidkarolis/karma-webpack-grep-super-fast-tests-in-dev-b11130e2c2c6 in case anyone's interested.
from karma-webpack.
Hi @KidkArolis nice post. I had a similar issue as yours due to our very large code base. Your post may solve our test problem. But I wonder how do you solve your incremental build issue (you should also have). I run webpack in watch mode, but whenever I change a file, it takes over 1 minute to compile&bundle which is way too long for developer.
from karma-webpack.
In my experience the incremental build is only slow if you use the wrong
sourcemap (devtool) option. Try them all to find the fast one..
On Fri, 12 Feb 2016 at 17:55, Larry He [email protected] wrote:
Hi @KidkArolis https://github.com/KidkArolis nice post. I had a similar
issue as yours due to our very large code base. Your post may solve our
test problem. But I wonder how do you solve your incremental build issue
(you should also have). I run webpack in watch mode, but whenever I change
a file, it takes over 1 minute to compile&bundle which is way too long for
developer.—
Reply to this email directly or view it on GitHub
#47 (comment)
.
from karma-webpack.
Related Issues (20)
- karma-webpack 5.0 No longer notified of compilation starting HOT 2
- Cannot read property 'entry' of undefined
- Cannot read property 'entry' of undefined
- karma-webpack 5 fails to read files with a query parameter (e.g. font-awesome) HOT 6
- 5.0 crashes on MacOS (Preprocessor, Plugin), fixed on master -> Release 5.1? HOT 7
- Trying to add karma-webpack to angular karma config HOT 2
- karma.conf.js being treated as entrypoint results in many errors from webpack 5 HOT 2
- Webpack Errors being reported twice.
- Process is not defined HOT 1
- Error during file loading or preprocessing HOT 7
- Webpack file cache isn't generated when webacpack watch option is false/nothing
- karma-webpack does not respect webpack mode = "production" HOT 3
- I have the same problem. HOT 1
- preprocessor change between v4 & v5 leading to error when used with karma-mocha HOT 15
- Issue with Webpack 5 unable to find file 404 (works with webpack 4) HOT 1
- Don't warn overriding [name].js to [name].js
- Figure out a publishing Github Workflow
- Ensure all project dependencies have no auditing issues
- Provide a migration path from karma-webpack
- Update the README.md
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from karma-webpack.