Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Prevent chunking out when not in production environment#50

Open
jalooc wants to merge1 commit intowebpack-contrib:master
base:master
Choose a base branch
Loading
fromjalooc:master

Conversation

@jalooc
Copy link

Due to HMR problems with on-demand chunks, I figured it would be nice if the loader loaded the chunks synchronously when in dev environment and as so far in prod. And that's what this commit does.

Other ideas: I was also wondering about adding some additional flag toforce async loading in development, but eventually opted-out. Alternatively, sync loading in development could be made an optional (instead of default) behavior. If you find some of the modifications useful, I'd be happy to alter the merge request to suit more needs.

@jsf-clabot
Copy link

jsf-clabot commentedApr 26, 2017
edited
Loading

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@michael-ciniawskymichael-ciniawsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@jalooc I'm not regularly using this loader so I need to get other eyes on this aswell 😛

}
varresult;
if(query.lazy){
if(process.env.NODE_ENV!=='production'){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think it's better to introduce an option here,NODE_ENV === 'production' is common, but no real standard

@jalooc
Copy link
Author

I was also wandering about adding an option(just another env var) forcing synchronous load, which could be potentially useful in static page rendering e.g. for ssr or bots. Do you think it's a good idea?

@michael-ciniawsky
Copy link
Member

michael-ciniawsky commentedApr 28, 2017
edited
Loading

@jalooc If you are not enterily pissed of in case we maybe need to revert a few things afterwards, then please go ahead and we will see if it is something we should add or not 😛

I was also wandering about adding an option (just another env var)

Just and option (query), egrequire(bundle-loader?sync&name=[name]!./file.bundle.js)
Could you also try if webpacj 2 snytax and setting the loader up inwebpack.config.js basically works ? 🙃

entry.js

importbundlefrom'./name.bundle.js'

webpack.config.js

{test:/\.bundle\.js$/,use:{loader:'bundle-loader',options:{name:'[name]'}}},{test:/\bundle\.async\.js$/,use:{loader:'bundle-loader',options:{lazy:true,name:'[name]'}}}

etc 😛

Maybe if we add async option, we should renamelazy =>async and cut a major release together with#48 what do you think 🙃 ?

@joshwiens
Copy link
Member

@michael-ciniawsky
Copy link
Member

kk, so sync doesn't make any sense at all ? I was wondering about it, but not 💯 since i'm not using this loader extensively. If so we better close the PR :)

@jalooc
Copy link
Author

@michael-ciniawsky I'm not sure if I fully understand your point. The suggested in this PR ability for skipping chunking-out (I called it sync loading before, but maybe it was confusing) is just for development purposes, so files naming convention wouldn't be right for this application. I also don't think it's related with#51.

@michael-ciniawskymichael-ciniawsky removed their assignmentFeb 23, 2019
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@bebrawbebrawAwaiting requested review from bebraw

@joshwiensjoshwiensAwaiting requested review from joshwiens

1 more reviewer

@michael-ciniawskymichael-ciniawskymichael-ciniawsky left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

v0.6.0

Development

Successfully merging this pull request may close these issues.

4 participants

@jalooc@jsf-clabot@michael-ciniawsky@joshwiens

[8]ページ先頭

©2009-2025 Movatter.jp