Created
February 27, 2021 00:05
-
-
Save dayhaysoos/96c89b35105ed04b92d0fa3ab473e849 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sucrase from '@rollup/plugin-sucrase' | |
import commonjs from '@rollup/plugin-commonjs' | |
import resolve from '@rollup/plugin-node-resolve' | |
import url from '@rollup/plugin-url' | |
import pkg from './package.json' | |
export default [ | |
{ | |
input: 'src/index.js', | |
external: ['react', 'crypto'], | |
output: [ | |
{ | |
file: pkg.main, | |
format: 'cjs', | |
sourcemap: true | |
}, | |
{ | |
file: pkg.module, | |
format: 'es', | |
sourcemap: true | |
}, | |
{ | |
name: 'UseShoppingCart', | |
file: pkg.umd, | |
format: 'umd', | |
sourcemap: true, | |
globals: { react: 'React', crypto: 'crypto' } | |
} | |
], | |
plugins: [ | |
url({ exclude: ['**/*.svg'] }), | |
sucrase({ | |
exclude: 'node_modules/**/*', | |
transforms: ['jsx'] | |
}), | |
resolve(), | |
commonjs() | |
] | |
}, | |
{ | |
input: 'core/slices/cartSlice.js', | |
external: ['@reduxjs/toolkit', 'uuid'], | |
output: [ | |
{ | |
file: pkg.main, | |
format: 'cjs', | |
sourcemap: true, | |
exports: 'named' | |
}, | |
{ | |
file: pkg.module, | |
format: 'es', | |
sourcemap: true, | |
exports: 'named' | |
}, | |
{ | |
name: 'UseShoppingCart-Core', | |
file: pkg.umd, | |
format: 'umd', | |
sourcemap: true, | |
globals: { | |
react: 'React', | |
uuid: 'uuid', | |
'@reduxjs/toolkit': '@reduxjs/toolkit' | |
} | |
} | |
], | |
plugins: [ | |
url({ exclude: ['**/*.svg'] }), | |
sucrase({ | |
exclude: 'node_modules/**/*', | |
transforms: ['jsx'] | |
}), | |
resolve(), | |
commonjs() | |
] | |
} | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment