feat: provide usable UMD builds for all packages (#2141)

This commit is contained in:
Tony Alves
2019-03-16 15:44:29 -07:00
committed by Shawn Erquhart
parent 1d935c704d
commit 82cc7941cc
89 changed files with 1025 additions and 712 deletions

View File

@ -1,3 +1,4 @@
const path = require('path');
const isProduction = process.env.NODE_ENV === 'production';
const isTest = process.env.NODE_ENV === 'test';
@ -29,6 +30,24 @@ const plugins = () => {
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
'@babel/plugin-proposal-export-default-from',
[
'module-resolver',
{
root: path.join(__dirname, 'packages/netlify-cms-core/src/components'),
alias: {
coreSrc: path.join(__dirname, 'packages/netlify-cms-core/src'),
Actions: path.join(__dirname, 'packages/netlify-cms-core/src/actions/'),
Constants: path.join(__dirname, 'packages/netlify-cms-core/src/constants/'),
Formats: path.join(__dirname, 'packages/netlify-cms-core/src/formats/'),
Integrations: path.join(__dirname, 'packages/netlify-cms-core/src/integrations/'),
Lib: path.join(__dirname, 'packages/netlify-cms-core/src/lib/'),
Reducers: path.join(__dirname, 'packages/netlify-cms-core/src/reducers/'),
Redux: path.join(__dirname, 'packages/netlify-cms-core/src/redux/'),
Routing: path.join(__dirname, 'packages/netlify-cms-core/src/routing/'),
ValueObjects: path.join(__dirname, 'packages/netlify-cms-core/src/valueObjects/'),
},
},
],
];
if (isProduction) {
@ -65,6 +84,7 @@ const plugins = () => {
];
}
defaultPlugins.push('react-hot-loader/babel');
return [
...defaultPlugins,
[