Files
dolt/jsmodules/webpack-config/run.py
Ben Kalman 11c79b2d56 Add run.py script to jsmodules/webpack-config (#1243)
This is intended to replace simpler uses of .npm_run_helper.py, then
    I'll continually migrate views until they can use the simpler form.
    Currently it will only be Splore that uses it.
2016-04-13 16:31:08 -07:00

24 lines
708 B
Python

#!/usr/bin/env python
import argparse, os, subprocess, sys
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--out', type=str, help='destination js file')
parser.add_argument('--src', type=str, help='source of main js file')
parser.add_argument('mode', type=str, help='"production" or "development"')
args = parser.parse_args()
env = {
'NODE_ENV': args.mode,
'BABEL_ENV': args.mode,
}.update(os.environ)
subprocess.check_call(
['node_modules/.bin/webpack',
'--config', 'node_modules/@attic/webpack-config/index.js', args.src, args.out],
env=env, shell=False)
if __name__ == "__main__":
main()