summaryrefslogtreecommitdiffstats
path: root/scripts/build.js
blob: 3b08843f4c1ea10cf85aa66e2cb2bf9ef0efc00b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use strict';
const fs = require('fs-extra')

// Do this as the first thing so that any code reading it knows the right env.
process.env.NODE_ENV = 'production';

import { rollup } from 'rollup';
import config from '../config/rollup';

rollup(config).then(( bundle ) => {
    return bundle.write({
      format: 'cjs',
      dest: 'index.js'
    });
  })
  .then(() => {
    fs.copy('styles.css', 'styles.scss', (err) => {
      if (err) return console.error(err)
    });
  })
  .then(() => console.log('Build Done.'));