( ) . , - this. script, , webpack.
, , :) , setup.py, setup.py install develop, npm install - .
, :
entry_points={
"console_scripts": [
"mywebpack=script_build:main",
]
},
script
from os.path import exists, dirname, join
from subprocess import Popen
import sys
def main():
path = dirname(__file__)
args = sys.argv[1:]
webpack_invocation = join(path, 'node_modules', '.bin', 'webpack')
webpack_command = [webpack_invocation] + args
process = Popen(webpack_invocation, cwd=path, shell=True)
process.wait()
if __name__ == "__main__":
main()
mywebpack <options>
, webpack:)
, !