mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-08 02:36:27 -05:00
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.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#!/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()
|
||||
Reference in New Issue
Block a user