Skip to content

Commit

Permalink
Chore/update rollup (mui#1027)
Browse files Browse the repository at this point in the history
* Update packages

* Fix rollup errors, enable umd bundle

* Remove unused deps from lib/package.json
  • Loading branch information
dmtrKovalenko authored May 5, 2019
1 parent da431e3 commit 5be8ca2
Show file tree
Hide file tree
Showing 6 changed files with 178 additions and 119 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"@mapbox/rehype-prism": "^0.3.1",
"@material-ui/core": "^4.0.0-alpha.7",
"@material-ui/icons": "^3.0.2",
"@material-ui/pickers": "^3.0.0-alpha.1",
"@material-ui/styles": "^4.0.0-alpha.7",
"@types/fuzzy-search": "^2.1.0",
"@types/luxon": "^1.11.0",
Expand All @@ -43,7 +44,6 @@
"jss": "^10.0.0-alpha.16",
"jss-rtl": "^0.2.3",
"luxon": "^1.11.2",
"@material-ui/pickers": "^3.0.0-alpha.1",
"material-ui-search-bar": "^1.0.0-beta.13",
"moment": "^2.24.0",
"moment-jalaali": "^0.8.3",
Expand Down
1 change: 0 additions & 1 deletion docs/pages/demo/datepicker/ViewsDatePicker.example.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ function YearMonthPicker() {
label="Year only"
value={selectedDate}
onChange={handleDateChange}
animateYearScrolling
/>

<DatePicker
Expand Down
10 changes: 10 additions & 0 deletions lib/.size-snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,15 @@
"code": 54436
}
}
},
"build/dist/material-ui-pickers.umd.js": {
"bundled": 1094102,
"minified": 355138,
"gzipped": 95738
},
"build/dist/material-ui-pickers.umd.min.js": {
"bundled": 847253,
"minified": 301273,
"gzipped": 82640
}
}
78 changes: 41 additions & 37 deletions lib/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const globals = {
'@material-ui/core/Tabs': 'material-ui.Tabs',
'@material-ui/styles': 'material-ui.styles',
'@material-ui/core/SvgIcon': 'material-ui.SvgIcon',
'@material-ui/core/styles/colorManipulator': 'material-ui.styles.colorManipulator',
};

const extensions = ['.ts', '.tsx'];
Expand All @@ -53,6 +54,9 @@ const babelOptions = {

const commonjsOptions = {
include: /node_modules/,
namedExports: {
'react-is': ['ForwardRef'],
},
};

export default [
Expand Down Expand Up @@ -91,43 +95,43 @@ export default [
],
},

// {
// input,
// external: Object.keys(globals),
// output: {
// globals,
// format: 'umd',
// name: pkg.name,
// file: 'build/dist/material-ui-pickers.umd.js',
// },
{
input,
external: Object.keys(globals),
output: {
globals,
format: 'umd',
name: pkg.name,
file: 'build/dist/material-ui-pickers.umd.js',
},

// plugins: [
// nodeResolve({ extensions }),
// typescriptPlugin({ typescript, tsconfig }),
// babel(babelOptions),
// commonjs(commonjsOptions),
// replace({ 'process.env.NODE_ENV': JSON.stringify('development') }),
// sizeSnapshot(),
// ],
// },
plugins: [
nodeResolve({ extensions }),
typescriptPlugin({ typescript, tsconfig }),
babel(babelOptions),
commonjs(commonjsOptions),
replace({ 'process.env.NODE_ENV': JSON.stringify('development') }),
sizeSnapshot(),
],
},

// {
// input,
// external: Object.keys(globals),
// output: {
// globals,
// format: 'umd',
// name: pkg.name,
// file: 'build/dist/material-ui-pickers.umd.min.js',
// },
// plugins: [
// nodeResolve({ extensions }),
// typescriptPlugin({ typescript, tsconfig }),
// babel(babelOptions),
// commonjs(commonjsOptions),
// replace({ 'process.env.NODE_ENV': JSON.stringify('production') }),
// sizeSnapshot(),
// uglify(),
// ],
// },
{
input,
external: Object.keys(globals),
output: {
globals,
format: 'umd',
name: pkg.name,
file: 'build/dist/material-ui-pickers.umd.min.js',
},
plugins: [
nodeResolve({ extensions }),
typescriptPlugin({ typescript, tsconfig }),
babel(babelOptions),
commonjs(commonjsOptions),
replace({ 'process.env.NODE_ENV': JSON.stringify('production') }),
sizeSnapshot(),
uglify(),
],
},
];
3 changes: 2 additions & 1 deletion lib/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"esModuleInterop": true,
"suppressImplicitAnyIndexErrors": true
"suppressImplicitAnyIndexErrors": true,
"resolveJsonModule": true
},
"include": ["src/**/*.ts*", "typings.d.ts"],
"exclude": ["./src/__tests__/**/*", "build"]
Expand Down
Loading

0 comments on commit 5be8ca2

Please sign in to comment.