build: use ES module format rollup.config.js (#259)

This commit is contained in:
fisker Cheung 2019-10-14 11:17:36 +08:00 committed by Evan You
parent 37f34c050f
commit 1baa19aea5

View File

@ -1,9 +1,9 @@
const fs = require('fs') import fs from 'fs'
const path = require('path') import path from 'path'
const ts = require('rollup-plugin-typescript2') import ts from 'rollup-plugin-typescript2'
const replace = require('rollup-plugin-replace') import replace from 'rollup-plugin-replace'
const alias = require('rollup-plugin-alias') import alias from 'rollup-plugin-alias'
const json = require('rollup-plugin-json') import json from 'rollup-plugin-json'
if (!process.env.TARGET) { if (!process.env.TARGET) {
throw new Error('TARGET package must be specified via --environment flag.') throw new Error('TARGET package must be specified via --environment flag.')
@ -68,7 +68,7 @@ if (process.env.NODE_ENV === 'production') {
}) })
} }
module.exports = packageConfigs export default packageConfigs
function createConfig(output, plugins = []) { function createConfig(output, plugins = []) {
const isProductionBuild = const isProductionBuild =