fix(rollup): set correct output options

This commit is contained in:
Pooya Parsa 2018-12-30 00:21:47 +03:30
parent de28c26284
commit fc1ab1eb44

View File

@ -27,11 +27,14 @@ export default function rollupConfig({
pkg = readJSONSync(path.resolve(rootDir, 'package.json')) pkg = readJSONSync(path.resolve(rootDir, 'package.json'))
} }
const name = path.basename(pkg.name.replace('-edge', ''))
return defaultsDeep({}, options, { return defaultsDeep({}, options, {
input: path.resolve(rootDir, input), input: path.resolve(rootDir, input),
output: { output: {
file: `${pkg.name.replace('-edge', '')}.js`,
dir: path.resolve(rootDir, 'dist'), dir: path.resolve(rootDir, 'dist'),
entryFileNames: `${name}.js`,
chunkFileNames: `${name}-[name].js`,
format: 'cjs', format: 'cjs',
preferConst: true preferConst: true
}, },