Comments (7)
One easy way to test in advance whether an AMD ModuleKind
would work is to use a CommonJS-to-AMD converter, and time the results of working with the AMD module (discounting the time taken by the converter).
from scalajs-bundler.
Not sure webpack-dev-server would help because anyway the output of Scala.js is one module of several megabytes.
Another solution would be to have another kind of ModuleKind
which would emit AMD modules so that there would be no need of bundling process (we would just need to transform the modules (once) into the AMD format).
from scalajs-bundler.
Some numbers.
Working with a 5k SLOC application, here are some timings when editing code and reloading the app:
Configuration | Whole reload | Bundling part |
---|---|---|
fullOptJS , no source maps |
27 s | 6 s |
fastOptJS , no source maps |
21 s | 15 s |
fastOptJS , with source maps |
40 s | 32 s |
Edit: more numbers!
Configuration | Whole reload | Bundling part |
---|---|---|
fastOptJS , no source maps, pre-bundling |
6s | 0s |
fastOptJS , with source maps, pre-bundling |
7s | 0s |
from scalajs-bundler.
Another solution suggested on gitter: bundle all the dependencies and export them in a way that can be directly used by the output of Scala.js (so that this output doesn’t need to be processed by webpack).
from scalajs-bundler.
Have you looked into rollup instead of webpack? I've heard it's a lot faster.
from scalajs-bundler.
I will probably do some tests with rollup, yes.
from scalajs-bundler.
scala-js/scala-js#2175 (comment) implies rollup can take 1/4 the time webpack takes
from scalajs-bundler.
Related Issues (20)
- is npm ci supported? HOT 3
- The Strict Mode emitted by Scala.js is not always preserved
- Add first-class support for frozen lockfiles HOT 7
- Generated source map points to incorrect URLs
- BundlingMode.LibraryOnly ignores `require` and `js.import`
- Documentation reports incorrect version HOT 3
- installJsdom may installs jsdom outside of the target directory
- Support `packageManager` in package.json
- Support Node Version Manager (NVM) HOT 2
- Error parsing webpack stats output HOT 6
- Providing `nodeExecCommand` setting HOT 4
- Yarn 2 throws `Unsupported option name ("--mutex")`
- sourcemap not work with BundlingMode.LibraryAndApplication
- Release v0.21.0 HOT 1
- Use with IntegrationTests
- BundlingMode.LibraryAndApplication() does not work with sourcemap to false
- digital envelope routines::unsupported on node versions > 16 HOT 3
- `AssertionError` on sbt 1.8.0 HOT 4
- webpackExtraArgs is ignored
- Could this be published with SBT 1.9.x?
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 scalajs-bundler.