You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
688 B
29 lines
688 B
import path from 'path';
|
|
import fs from 'fs';
|
|
import babel from 'rollup-plugin-babel';
|
|
|
|
let pkg = JSON.parse(fs.readFileSync('./package.json'));
|
|
|
|
let external = Object.keys(pkg.peerDependencies || {}).concat(Object.keys(pkg.dependencies || {}));
|
|
|
|
export default {
|
|
entry: 'src/index.js',
|
|
dest: pkg.main,
|
|
sourceMap: path.resolve(pkg.main),
|
|
moduleName: pkg.amdName,
|
|
format: 'umd',
|
|
external,
|
|
plugins: [
|
|
babel({
|
|
babelrc: false,
|
|
comments: false,
|
|
exclude: ['node_modules/**'],
|
|
presets: ['es2015-loose-rollup'],
|
|
plugins: [
|
|
['transform-es2015-classes', { loose:true }],
|
|
['transform-object-rest-spread'],
|
|
['transform-react-jsx', { pragma: 'h' }]
|
|
]
|
|
})
|
|
]
|
|
};
|