Skip to content

Commit

Permalink
Merge 6e4a47f into 0c8e41d
Browse files Browse the repository at this point in the history
  • Loading branch information
jbadan committed Oct 16, 2019
2 parents 0c8e41d + 6e4a47f commit aa4c6fd
Show file tree
Hide file tree
Showing 9 changed files with 864 additions and 36 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ For an existing react application, follow the steps below:

> **NOTE:** Importing from specific component is recommended. Doing so will bring in only the component you are using instead of the whole library, which will reduce your bundle size significantly.
## UMD releases

We are providing two Universal Module Definition (UMD) files:

- one for development: https://unpkg.com/fundamental-react@latest/umd/fundamental-react.development.js
- one for production: https://unpkg.com/fundamental-react@latest/umd/fundamental-react.production.min.js


## Versioning
Expand Down
17 changes: 8 additions & 9 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
const path = require('path');

const defaultPresets = [
'@babel/preset-react',
[
'@babel/preset-env',
{
modules: 'commonjs'
modules: ['production-umd'].includes(process.env.BABEL_ENV) ? false : 'commonjs'
}
]
];

const defaultPlugins = [
['@babel/plugin-proposal-class-properties', { loose: true }],
['@babel/plugin-proposal-object-rest-spread', { loose: true }],
'@babel/plugin-transform-runtime',
'@babel/plugin-transform-object-assign'
];

const productionPlugins = [
'babel-plugin-transform-react-constant-elements',
[
'transform-react-remove-prop-types',
{
Expand All @@ -27,16 +28,14 @@ const productionPlugins = [
];

module.exports = {
presets: defaultPresets,
presets: defaultPresets.concat(['@babel/preset-react']),
plugins: defaultPlugins,
env: {
production: {
presets: [
[
'@babel/preset-env'
]
],
cjs: {
plugins: productionPlugins
},
'production-umd': {
plugins: [...productionPlugins, ['@babel/plugin-transform-runtime', { useESModules: true }]]
}
}
};
6 changes: 1 addition & 5 deletions ci-scripts/publish-rc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,4 @@ npm run std-version -- --prerelease rc --no-verify

git push --follow-tags "https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG" "$TRAVIS_BRANCH" > /dev/null 2>&1;

npm run build:copy-files

cd lib

npm publish --tag prerelease
npm publish lib --tag prerelease
8 changes: 1 addition & 7 deletions ci-scripts/publish.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ echo "$std_ver"

git push --follow-tags "https://$GH_TOKEN@github.com/$TRAVIS_REPO_SLUG" master > /dev/null 2>&1;

npm run build:copy-files

cd lib

npm publish

cd ..
npm publish lib

# run this after publish to make sure GitHub finishes updating from the push
npm run release:create -- --repo $TRAVIS_REPO_SLUG --tag $release_tag --branch master
Expand Down
2 changes: 1 addition & 1 deletion devtools/buildIndexFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ componentDirs.map((directory) => {
//components not wrapped in HOC
fileContents += `export { default as ${components.default.name} } from './${fileName}';\n`;
}
} else {
} else if (!component.includes('__')) {
fileContents += `export { ${component} } from './${fileName}';\n`;
}
});
Expand Down
Loading

0 comments on commit aa4c6fd

Please sign in to comment.