Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 1.2.0 - npm run build - slowly!!! #15

Closed
lzsheng opened this issue Jul 14, 2017 · 9 comments
Closed

version 1.2.0 - npm run build - slowly!!! #15

lzsheng opened this issue Jul 14, 2017 · 9 comments
Labels

Comments

@lzsheng
Copy link

lzsheng commented Jul 14, 2017

从1.1.1版本升级至1.2.0版本后

运行官方browser-example的代码,执行npm start是很快的,但是在执行npm run build的时候,大概要构建2-3分钟。

在我自己的项目中(使用v1.1.1版本,构建时间大概是45s),但是升级了v1.2.0后等待超过10分钟依然不能构建成功!!!但是换回 v1.1.1 版本后,却能正常构建

请尽快解决这个问题~~辛苦啦

@lzsheng
Copy link
Author

lzsheng commented Jul 14, 2017

运行官方的browser-example,把版本降为1.1.1,速度明显比v1.2.0快很多!

@cwtuan
Copy link
Collaborator

cwtuan commented Jul 15, 2017

@lzsheng what's your node version and OS?

@cwtuan
Copy link
Collaborator

cwtuan commented Jul 15, 2017

Building browser-example consumes about 140s in both of v1.1.1 and v1.2 in my computer (Mac air, node v6.11.0)

@lzsheng
Copy link
Author

lzsheng commented Jul 16, 2017

nonde:7.2.1
macOS:10.12.4 (mbp 2016)

@lzsheng
Copy link
Author

lzsheng commented Jul 16, 2017

v1.2.0: building browser-example consumes about 114s
v1.1.1: building browser-example consumes about 12s

@cwtuan
Copy link
Collaborator

cwtuan commented Jul 16, 2017

Currently, you could use v1.1 if you only need browser rendering.
v1.2 supports server rendering.

@lzsheng
Copy link
Author

lzsheng commented Jul 16, 2017

ok,thx!

@Jorer
Copy link

Jorer commented Jul 27, 2017

There is a significant size difference in the builds between 1.1.1 and 1.2.0.

My locale loading goes something like this:

import intl from 'react-intl-universal';
import fi from './locales/fi';
import en from './locales/en';

const locales = {
  'fi-FI': fi,
  'en-US': en,
}
const locale = 'en-US';

const loadLocales = () => {
  intl.init({
    currentLocale: locale,
    locales,
  }).then(() => {
    //console.log("locales loaded");
  });
}

Building the package:
v1.1.1:
File sizes after gzip:
156.54 KB build/static/js/main.588b5386.js
2.21 KB build/static/css/main.aa3bb3e1.css

v1.2.0:
File sizes after gzip:
1003.92 KB (+847.34 KB) build/static/js/main.5580900c.js
2.21 KB build/static/css/main.aa3bb3e1.css

Checked the build with source-map-explorer and it does include locale data files for every language, not just the ones defined with the locales.

@cwtuan cwtuan closed this as completed in dd9e744 Aug 14, 2017
@cwtuan
Copy link
Collaborator

cwtuan commented Aug 14, 2017

@lzsheng @Jorer
Please upgrade to v1.3.4 to fix build issue.

@cwtuan cwtuan added the bug label Aug 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants