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

Decrease chart.js bytes #1368

Merged
merged 3 commits into from
Feb 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion client/app/stories/Chart.stories.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'chartjs';
import React from 'react';
import { storiesOf } from '@storybook/react';
import { Chart } from '../components/Chart';
Expand Down
1 change: 0 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"axios": "^0.18.0",
"babel-core": "7.0.0-bridge.0",
"chart.js": "^2.6.0",
"chartjs": "^0.3.24",
Copy link
Member

Choose a reason for hiding this comment

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

Great catch! Oh wow, we had that and chart.js 🤔

"chartkick": "^2.2.4",
"es5-shim": "^4.5.9",
"font-awesome": "^4.7.0",
Expand Down
3 changes: 3 additions & 0 deletions client/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const ManifestPlugin = require('webpack-manifest-plugin');
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const webpackConfigLoader = require('react-on-rails/webpackConfigLoader');
const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
const webpack = require('webpack');
const baseConfig = require('./webpack.config.base');

const configPath = resolve('..', 'config');
Expand Down Expand Up @@ -99,6 +100,8 @@ const config = Object.assign(baseConfig, {
hot: !!devOrTestMode,
}),
new ManifestPlugin({ publicPath: output.publicPath, writeToFileEmit: true }),
// only load moment.js data for locales we support (see config/locale.rb)
new webpack.ContextReplacementPlugin(/moment[/\\]locale$/, /en|es|de|it|nb|nl|pt-BR|sv|vi|fr/),
],

module: {
Expand Down
5 changes: 0 additions & 5 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2762,11 +2762,6 @@ chartjs-color@^2.1.0:
chartjs-color-string "^0.5.0"
color-convert "^0.5.3"

chartjs@^0.3.24:
version "0.3.24"
resolved "https://registry.yarnpkg.com/chartjs/-/chartjs-0.3.24.tgz#3addeb5ae3606b3e89e346c27d52ca158416e93d"
integrity sha1-Ot3rWuNgaz6J40bCfVLKFYQW6T0=

chartkick@^2.2.4:
version "2.3.6"
resolved "https://registry.yarnpkg.com/chartkick/-/chartkick-2.3.6.tgz#a507c54da7d117e66c9a9c5309f7ecccc2d28b51"
Expand Down