clockify-calculator-chrome-extension's People
clockify-calculator-chrome-extension's Issues
Decrease build file volume
문제 사항: webpack으로 빌드한 파일의 용량(약 4.2 MB)이 크다. webpack으로 빌드하지 않았을 때 용량(415 KB)에 비해 너무 크다.
- Pure HTML, JS, CSS + minified lib(lodash, moment): 415 KB
- Webpack
development
mode build: 4.2 MB - Webpack
production
mode build: 1.6 MB
Webpack Plugin 중 Webpack BundleAnalyzerPlugin 사용하여 분석. 해당 플러그인 사용하여 빌드할 경우, 분석결과를 자동으로 보여준다.
분석결과: moment.js와 lodash 를 사용하는 popup.js의 용량이 큼.
Moment.js 최적화
moment.js 는 모든 locale이 다 들어가서 용량이 커져 locale 제외한 기본 라이브러리만 넣는 방법을 적용.
- Webpack
development
mode + MomentLocalesPlugin 사용: 2.9 MB - Webpack
production
mode + MomentLocalesPlugin 사용: 570 KB
Lodash 최적화
lodash-es는 메소드만 사용해서 큰 용량을 차지하지 않을 줄 알았지만, 전체가 다 들어감. lodash 메소드 import 방법 조정 및 LodashModuleReplacementPlugin 적용.
// 메소드 import 방법 1 => development mode에서는 효과가 미미했다.
import { map, reverse } from 'lodash-es'
// 메소드 import 방법 2 => development mode에서는 효과가 대단했다.
import map from 'lodash/map'
import reverse from 'lodash/reverse'
처음에는 메소드 import 방법 1
을 사용하였지만 development
mode에서는 큰 효과를 볼 수 없었다. (LodashModuleReplacementPlugin README에서는 babel을 사용해야한다는 설명이 있었다.)
- Webpack
development
mode + MomentLocalesPlugin + 메소드 import 방법 1 + LodashModuleReplacementPlugin(Babel 사용 안함): 2.6 MB - Webpack
production
mode + MomentLocalesPlugin + 메소드 import 방법 1 + LodashModuleReplacementPlugin(Babel 사용 안함): 388 KB
Tree shake Lodash Solution 2 ( no babel )을 참고하여 메소드 import 방법 2
를 적용해 봄.
- Webpack
development
mode + MomentLocalesPlugin + 메소드 import 방법 2: 720 KB- 플러그인을 사용하지 않고도 큰 효과가 있었다.
- Webpack
development
mode + MomentLocalesPlugin + 메소드 import 방법 2 + LodashModuleReplacementPlugin(Babel 사용 안함) : 426 KB - Webpack
production
mode + MomentLocalesPlugin + 메소드 import 방법 2 + LodashModuleReplacementPlugin(Babel 사용 안함): 388 KB
결국 production
mode에서는 같은 파일 용량.
inline source map 제거
배포용
- Webpack
production
mode + MomentLocalesPlugin + LodashModuleReplacementPlugin(Babel 사용 안함) + source map 제거: 59 KB
Apply build tool
Apply Build tool webpack v4
Change the way to get data
현재는 HTML 태그를 Parsing해서 데이터를 얻고 있으나, API 호출을 하여 데이터를 얻고 싶다.
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.