Comments (6)
Could you provide a reproduction-repo?
from lazy-compile-webpack-plugin.
Sure! Ran into some setup issues when duplicating fresh repo. Reaching out to storybook team first.
from lazy-compile-webpack-plugin.
There was an issue I ran into trying to repro. But found out it doesn't even work with most recent storybook.
storybookjs/storybook#10156
Still waiting for their response, but thought it might help to post it here as well, as other plugins seem to work fine but not lazy-compile-webpack-plugin
from lazy-compile-webpack-plugin.
@liximomo I think I have some new information. Reached out to storybook team, and they are using https://www.npmjs.com/package/virtual-module-webpack-plugin
in their latest version.
This means their file is sometimes generated in the cache and not available on the disk. In your code
async _recompile(filename) {
return new Promise((resolve, reject) => {
const now = new Date();
// trigger watcher to recompile
fs.utimes(filename, now, now, err => {
if (err) {
return reject(err);
}
resolve();
});
});
}
utime relies on the file system on found modules. And that is causing it to be incompatible with newer storybook version.
This is not super related to the issueI raised. If you prefer I raise it as a separate issue for semantic I could.
For now I'll focus on duplicating this issue with an older version of storybook (if that's possible)
from lazy-compile-webpack-plugin.
@liximomo I have successfully duplicated the bug in the repository:
https://github.com/devtreehouse/StorybookLazyCompile
To start the app, clone the repo, do yarn
, and then yarn storybook
. Storybook will spin up.
Sometimes the build only does once, sometimes it does twice or even 3 times.
In our production repo, one build takes 2 minutes, so... rebuilding means waiting for 2 more minutes randomly, that means it defeats the purpose of saving time on lazy compile.
Additional context:
In our main app, I realized that on the second build, it goes and try to do a full build, that means all react suspense (code splitted) code will be built. But it doesn't happen on the first time.
Also I noticed the first build is not success, as some images on our webpage are not being displayed. I think it might be webpack trying to make up for it, but it never happens without this plugin enabled.
Would greatly appreciate it if you can take a look. I really want to use this in our official dev environment
from lazy-compile-webpack-plugin.
Reopening a new issue as too much irrelevant information is in this thread
from lazy-compile-webpack-plugin.
Related Issues (10)
- webpack3δΌζ₯ιε’ HOT 1
- fix apiPath on Windows system.
- The compatible path on windows system. HOT 1
- Lazy compile with storybook preset causes double build on initialization
- Cannot read property 'beforeCompile' of undefined HOT 1
- Webpack 5 support HOT 1
- Support multi-page app by marking html-webpack-plugin entries as lazy HOT 2
- Fallback element with `React.lazy` HOT 3
- ReferenceError: document is not defined HOT 4
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 lazy-compile-webpack-plugin.